From a3a4978b37ee02c6fa2656fbb06c412cfbd68ba3 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 16:09:13 -0700 Subject: [PATCH 001/104] Added frameworkSpec and different types used for discoving frameworks --- .../compose/discover/frameworkSpec.ts | 38 +++++++ src/frameworks/compose/discover/types.ts | 106 ++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 src/frameworks/compose/discover/frameworkSpec.ts create mode 100644 src/frameworks/compose/discover/types.ts diff --git a/src/frameworks/compose/discover/frameworkSpec.ts b/src/frameworks/compose/discover/frameworkSpec.ts new file mode 100644 index 00000000000..09c1230a372 --- /dev/null +++ b/src/frameworks/compose/discover/frameworkSpec.ts @@ -0,0 +1,38 @@ +import { FrameworkSpec } from "./types"; + +export const frameworkSpecs: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + webFrameworkId: "Express.js", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + { + id: "nextjs", + runtime: "nodejs", + webFrameworkId: "Next.js", + requiredFiles: ["next.config.js", "next.config.ts"], + requiredDependencies: [ + { + name: "next", + }, + ], + commands: { + build: { + cmd: "npx next build", + }, + dev: { + cmd: "npx next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "npx next run", + env: { NODE_ENV: "production" }, + }, + }, + }, +]; \ No newline at end of file diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts new file mode 100644 index 00000000000..52a6869057a --- /dev/null +++ b/src/frameworks/compose/discover/types.ts @@ -0,0 +1,106 @@ +export interface FileSystem { + exists(file: string): Promise; + read(file: string): Promise; + } + + export interface Runtime { + match(fs: FileSystem): Promise; + getRuntimeName(): string; + analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; + } + + export interface Command { + // Consider: string[] for series of commands that must execute successfully + // in sequence. + cmd: string | string[]; + script?:string; + env?: Record; + } + + export interface LifecycleCommands { + build?: Command; + run?: Command; + dev?: Command; + } + + export interface FrameworkSpec { + id: string; + + // This Framework is a refinement of the parent framework. It can only be + // selected when the parent's requirements are also met. If this framework + // matches, its scripts take precedence over the parent's scripts. + requireFramework?: string; + + // Only analyze Frameworks with a runtime that matches the matched runtime + runtime: string; + + // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the + // FrameworkSpec agree with one another + webFrameworkId?: string; + + // VSCode plugins that assist with writing a particular framework + suggestedPlugins?: string[]; + + requiredDependencies: Array<{ + name: string; + semver?: string; + }>; + + // If a requiredFiles is an array, then one of the files in the array must match. + // This supports, for example, a file that can be a js, ts, or mjs file. + requiredFiles?: Array; + + // Any commands that this framework needs that are not standard for the + // runtime. Often times, this can be empty (e.g. depend on npm run build and + // npm run start) + commands?: LifecycleCommands; + + // We must resolve to a single framework when getting build/dev/run commands. + // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" + // can embed "svelte", so if both frameworks are discovered, monospace can + // suggest both frameworks' plugins, but should run astro's commands. + embedsFrameworks?: string[]; + + samples?: FrameworkSample[]; + } + + export interface RuntimeSpec { + // e.g. `nodejs` + id: string; + + // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) + baseImage: string; + + // e.g. `npm install yarn typescript` + packageManagerInstallCommand?: string; + + // e.g. `npm ci`, `npm install`, `yarn` + installCommand?: string; + + // Commands to run right before exporting the container image + // e.g. npm prune --omit=dev, yarn install --production=true + exportCommands?: string[]; + + // The runtime has detected a command that should always be run irrespective of + // the framework (e.g. the "build" script always wins in Node) + detectedCommands?: LifecycleCommands; + + fallbackCommands?: LifecycleCommands; + } + + export interface SampleInstallStrategy { + githubUrl: string; + command: string; + } + + export interface FrameworkSample { + name: string; + description: string; + icon: string; + + // oneof + install: SampleInstallStrategy; + + // e.g. "javascript" and "typescript" variants + installVariants: Record; + } \ No newline at end of file From 56e784482a4c3fb1ea4d3682ca06ee91fa307bc2 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 16:44:02 -0700 Subject: [PATCH 002/104] Added repository file system to check if file exists and to read file contents --- src/frameworks/compose/discover/filesystem.ts | 58 +++++++++++++++++++ .../compose/discover/filesystem.spec.ts | 34 +++++++++++ 2 files changed, 92 insertions(+) create mode 100644 src/frameworks/compose/discover/filesystem.ts create mode 100644 src/test/frameworks/compose/discover/filesystem.spec.ts diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts new file mode 100644 index 00000000000..279628cfe84 --- /dev/null +++ b/src/frameworks/compose/discover/filesystem.ts @@ -0,0 +1,58 @@ +import { FileSystem } from "./types"; +import { pathExists, readFile } from "fs-extra"; +import { join } from "path"; + +/** + * Find or read contents present in the Repository. + */ +export class RepositoryFileSystem implements FileSystem { + private readonly existsCache: Record = {}; + private readonly contentCache: Record = {}; + private readonly readErrorCache: Record = {}; + + constructor(private readonly cwd: string) {} + + async exists(file: string): Promise { + try { + if (!(file in this.contentCache)) { + // Get repository contents + this.existsCache[file] = await pathExists(join(this.cwd, file)); + } + + return this.existsCache[file]; + } catch (error: any) { + // File not found + console.error("Error occured while searching for file:", error.message); + return Promise.resolve(false); + } + } + + async read(path: string): Promise { + if (this.readErrorCache[path]) { + throw this.readErrorCache[path]; + } + if (!(path in this.contentCache)) { + try { + const fileContents = await readFile(join(this.cwd, path), "utf-8"); + this.contentCache[path] = fileContents; + } catch (error: any) { + new Error("Can't read file contents."); + } + } + return this.contentCache[path]; + } +} + +/** + * Convert ENOENT errors into null + */ +export async function readOrNull(fs: FileSystem, path: string): Promise { + try { + return fs.read(path); + } catch (err: unknown) { + if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") { + return null; + } + throw err; + } +} \ No newline at end of file diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts new file mode 100644 index 00000000000..639ea437652 --- /dev/null +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -0,0 +1,34 @@ +import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { expect } from "chai"; + +describe("RepositoryFileSystem", () => { + let fileSystem: RepositoryFileSystem; + + before(() => { + fileSystem = new RepositoryFileSystem( + "/Users/svnsairam/Documents/google3/firebase-tools/src/frameworks/compose/discover/nodetestapp/nodeapp" + ); + }); + + describe("exists", () => { + it("should return true if file exists in the directory ", async () => { + const fileExists = await fileSystem.exists("package.json"); + + expect(fileExists).to.equal(true); + }); + + it("should return false if file does not exist in the directory", async () => { + const fileExists = await fileSystem.exists("nonexistent.txt"); + + expect(fileExists).to.equal(false); + }); + }); + + describe("read", () => { + it("should read and return the contents of the file", async () => { + const fileContent = await fileSystem.read("package.json"); + + expect(fileContent).to.equal(fileContent); + }); + }); +}); From 560a9b3d976c25e84db0eceae3399be668dbfcd0 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:28:37 -0700 Subject: [PATCH 003/104] Removed comments and modified error handling. --- src/frameworks/compose/discover/filesystem.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 279628cfe84..f5a4404f177 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,9 +1,10 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import { join } from "path"; +import { logger } from "../../.."; /** - * Find or read contents present in the Repository. + * Find files or read contents present in the Repository. */ export class RepositoryFileSystem implements FileSystem { private readonly existsCache: Record = {}; @@ -15,15 +16,13 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { if (!(file in this.contentCache)) { - // Get repository contents this.existsCache[file] = await pathExists(join(this.cwd, file)); } return this.existsCache[file]; } catch (error: any) { - // File not found - console.error("Error occured while searching for file:", error.message); - return Promise.resolve(false); + logger.error("Error occured while searching for file:", error.message); + throw error; } } @@ -36,7 +35,8 @@ export class RepositoryFileSystem implements FileSystem { const fileContents = await readFile(join(this.cwd, path), "utf-8"); this.contentCache[path] = fileContents; } catch (error: any) { - new Error("Can't read file contents."); + logger.error("Error occured while reading file contents:", error.message); + throw error; } } return this.contentCache[path]; @@ -53,6 +53,7 @@ export async function readOrNull(fs: FileSystem, path: string): Promise Date: Thu, 8 Jun 2023 18:00:25 -0700 Subject: [PATCH 004/104] Resolved indentation issues --- src/frameworks/compose/discover/filesystem.ts | 2 +- .../compose/discover/frameworkSpec.ts | 2 +- src/frameworks/compose/discover/types.ts | 208 +++++++++--------- 3 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index f5a4404f177..298ab8279d4 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -56,4 +56,4 @@ export async function readOrNull(fs: FileSystem, path: string): Promise; - read(file: string): Promise; - } - - export interface Runtime { - match(fs: FileSystem): Promise; - getRuntimeName(): string; - analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; - } - - export interface Command { - // Consider: string[] for series of commands that must execute successfully - // in sequence. - cmd: string | string[]; - script?:string; - env?: Record; - } - - export interface LifecycleCommands { - build?: Command; - run?: Command; - dev?: Command; - } - - export interface FrameworkSpec { - id: string; - - // This Framework is a refinement of the parent framework. It can only be - // selected when the parent's requirements are also met. If this framework - // matches, its scripts take precedence over the parent's scripts. - requireFramework?: string; - - // Only analyze Frameworks with a runtime that matches the matched runtime - runtime: string; - - // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the - // FrameworkSpec agree with one another - webFrameworkId?: string; - - // VSCode plugins that assist with writing a particular framework - suggestedPlugins?: string[]; - - requiredDependencies: Array<{ - name: string; - semver?: string; - }>; - - // If a requiredFiles is an array, then one of the files in the array must match. - // This supports, for example, a file that can be a js, ts, or mjs file. - requiredFiles?: Array; - - // Any commands that this framework needs that are not standard for the - // runtime. Often times, this can be empty (e.g. depend on npm run build and - // npm run start) - commands?: LifecycleCommands; - - // We must resolve to a single framework when getting build/dev/run commands. - // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" - // can embed "svelte", so if both frameworks are discovered, monospace can - // suggest both frameworks' plugins, but should run astro's commands. - embedsFrameworks?: string[]; - - samples?: FrameworkSample[]; - } - - export interface RuntimeSpec { - // e.g. `nodejs` - id: string; - - // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) - baseImage: string; - - // e.g. `npm install yarn typescript` - packageManagerInstallCommand?: string; - - // e.g. `npm ci`, `npm install`, `yarn` - installCommand?: string; - - // Commands to run right before exporting the container image - // e.g. npm prune --omit=dev, yarn install --production=true - exportCommands?: string[]; - - // The runtime has detected a command that should always be run irrespective of - // the framework (e.g. the "build" script always wins in Node) - detectedCommands?: LifecycleCommands; - - fallbackCommands?: LifecycleCommands; - } - - export interface SampleInstallStrategy { - githubUrl: string; - command: string; - } - - export interface FrameworkSample { + exists(file: string): Promise; + read(file: string): Promise; +} + +export interface Runtime { + match(fs: FileSystem): Promise; + getRuntimeName(): string; + analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; +} + +export interface Command { + // Consider: string[] for series of commands that must execute successfully + // in sequence. + cmd: string | string[]; + script?: string; + env?: Record; +} + +export interface LifecycleCommands { + build?: Command; + run?: Command; + dev?: Command; +} + +export interface FrameworkSpec { + id: string; + + // This Framework is a refinement of the parent framework. It can only be + // selected when the parent's requirements are also met. If this framework + // matches, its scripts take precedence over the parent's scripts. + requireFramework?: string; + + // Only analyze Frameworks with a runtime that matches the matched runtime + runtime: string; + + // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the + // FrameworkSpec agree with one another + webFrameworkId?: string; + + // VSCode plugins that assist with writing a particular framework + suggestedPlugins?: string[]; + + requiredDependencies: Array<{ name: string; - description: string; - icon: string; - - // oneof - install: SampleInstallStrategy; - - // e.g. "javascript" and "typescript" variants - installVariants: Record; - } \ No newline at end of file + semver?: string; + }>; + + // If a requiredFiles is an array, then one of the files in the array must match. + // This supports, for example, a file that can be a js, ts, or mjs file. + requiredFiles?: Array; + + // Any commands that this framework needs that are not standard for the + // runtime. Often times, this can be empty (e.g. depend on npm run build and + // npm run start) + commands?: LifecycleCommands; + + // We must resolve to a single framework when getting build/dev/run commands. + // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" + // can embed "svelte", so if both frameworks are discovered, monospace can + // suggest both frameworks' plugins, but should run astro's commands. + embedsFrameworks?: string[]; + + samples?: FrameworkSample[]; +} + +export interface RuntimeSpec { + // e.g. `nodejs` + id: string; + + // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) + baseImage: string; + + // e.g. `npm install yarn typescript` + packageManagerInstallCommand?: string; + + // e.g. `npm ci`, `npm install`, `yarn` + installCommand?: string; + + // Commands to run right before exporting the container image + // e.g. npm prune --omit=dev, yarn install --production=true + exportCommands?: string[]; + + // The runtime has detected a command that should always be run irrespective of + // the framework (e.g. the "build" script always wins in Node) + detectedCommands?: LifecycleCommands; + + fallbackCommands?: LifecycleCommands; +} + +export interface SampleInstallStrategy { + githubUrl: string; + command: string; +} + +export interface FrameworkSample { + name: string; + description: string; + icon: string; + + // oneof + install: SampleInstallStrategy; + + // e.g. "javascript" and "typescript" variants + installVariants: Record; +} From 56195cfa0fb3322d2dd6c560cf9049c774c8b7e7 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:27:09 -0700 Subject: [PATCH 005/104] Discovery: Added code analyse codebase and match to a frameworkSpec --- .../compose/discover/frameworkMatcher.ts | 86 ++++++++++ .../compose/discover/frameworkMatcher.spec.ts | 156 ++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 src/frameworks/compose/discover/frameworkMatcher.ts create mode 100644 src/test/frameworks/compose/discover/frameworkMatcher.spec.ts diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts new file mode 100644 index 00000000000..48b29d23a0f --- /dev/null +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -0,0 +1,86 @@ +import { FrameworkSpec, FileSystem } from "./types"; + +/** + * + */ +export function filterFrameworksWithDependencies( + allFrameworkSpecs: FrameworkSpec[], + dependencies: Record +): FrameworkSpec[] { + return allFrameworkSpecs.filter((framework) => { + return framework.requiredDependencies.every((dependency) => + dependencies.hasOwnProperty(dependency["name"]) + ); + }); +} + +/** + * + */ +export function filterFrameworksWithFiles( + allFrameworkSpecs: FrameworkSpec[], + fs: FileSystem +): FrameworkSpec[] { + return allFrameworkSpecs.filter((framework) => { + if (!framework.requiredFiles) { + return true; + } + framework.requiredFiles.every((files) => { + if (Array.isArray(files)) { + return files.every((file) => fs.exists(file)); + } else { + return fs.exists(files); + } + }); + }); +} + +/** + * + */ +export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { + const embededFrameworkSet: Set = new Set(); + allFrameworkSpecs.forEach((framework) => { + if (!framework.embedsFrameworks) { + return; + } + framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); + }); + return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); +} + +/** + * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. + */ +export function frameworkMatcher( + runtime: string, + fs: FileSystem, + frameworks: FrameworkSpec[], + dependencies: Record +): FrameworkSpec | null { + try { + // Filter based on runtime name. + const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); + // Filter based on dependencies. + const frameworksWithDependencies = filterFrameworksWithDependencies( + filterRuntimeFramework, + dependencies + ); + // Filter based on files required. + const frameworkWithFiles = filterFrameworksWithFiles(frameworksWithDependencies, fs); + // Filter based on embeded Frameworks. + const allMatches = removeEmbededFrameworks(frameworkWithFiles); + + if (!allMatches.length) { + return null; + } + if (allMatches.length > 1) { + const frameworkNames = allMatches.map((framework) => framework.id); + throw new Error(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + } + + return allMatches[0]; + } catch (error: any) { + throw new Error("Failed to match the correct frameworkSpec", error.message); + } +} diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts new file mode 100644 index 00000000000..99992612666 --- /dev/null +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -0,0 +1,156 @@ +import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { expect } from "chai"; +import { + frameworkMatcher, + removeEmbededFrameworks, + filterFrameworksWithFiles, + filterFrameworksWithDependencies, +} from "../../../../frameworks/compose/discover/frameworkMatcher"; +import { frameworkSpecs } from "../../../../frameworks/compose/discover/frameworkSpec"; +import { FrameworkSpec } from "../../../../frameworks/compose/discover/types"; + +describe("frameworkMatcher", () => { + let fileSystem: RepositoryFileSystem; + const NODE_ID = "nodejs"; + + before(() => { + fileSystem = new RepositoryFileSystem("./testapps/express"); + }); + + describe("frameworkMatcher", () => { + it("should return express FrameworkSpec after analysing express application", () => { + const expressDependency: Record = { + express: "^4.18.2", + }; + const matchedFramework = frameworkMatcher( + NODE_ID, + fileSystem, + frameworkSpecs, + expressDependency + ); + const expressFrameworkSpec: FrameworkSpec = { + id: "express", + runtime: "nodejs", + webFrameworkId: "Express.js", + requiredDependencies: [ + { + name: "express", + }, + ], + }; + + expect(matchedFramework).to.equal(expressFrameworkSpec); + }); + }); + + describe("removeEmbededFrameworks", () => { + it("should return frameworks after removing embeded frameworks", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + embedsFrameworks: ["react"], + }, + { + id: "react", + runtime: "nodejs", + requiredDependencies: [], + }, + ]; + const actual = removeEmbededFrameworks(allFrameworks); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + embedsFrameworks: ["react"], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); + + describe("filterFrameworksWithFiles", () => { + it("should return frameworks having all the required files", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["package.json", "package-lock.json"], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["next.config.js", "next.config.ts"], + }, + ]; + const actual = filterFrameworksWithFiles(allFrameworks, fileSystem); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["package.json", "package-lock.json"], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); + + describe("filterFrameworksWithDependencies", () => { + it("should return frameworks having required dependencies with in the project dependencies", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [ + { + name: "next", + }, + ], + }, + ]; + const projectDependencies: Record = { + express: "^4.18.2", + }; + const actual = filterFrameworksWithDependencies(allFrameworks, projectDependencies); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); +}); From e516d6503aaa43ebd1628b380b8b482a6fe0775a Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:33:26 -0700 Subject: [PATCH 006/104] Added test express app --- .../testapps/expressApp/package-lock.json | 604 ++++++++++++++++++ .../discover/testapps/expressApp/package.json | 15 + 2 files changed, 619 insertions(+) create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json new file mode 100644 index 00000000000..36787cbc8cc --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json @@ -0,0 +1,604 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "expressapp", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json new file mode 100644 index 00000000000..4ffc74a94ff --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package.json @@ -0,0 +1,15 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } +} From d8c328663e2c868ca06063498ece4116ce0881cd Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:37:20 -0700 Subject: [PATCH 007/104] FileSystem now tests file existance and reads contents from test app --- src/frameworks/compose/discover/filesystem.ts | 18 +++++++-------- .../compose/discover/filesystem.spec.ts | 22 +++++++++++++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 298ab8279d4..51e1525958a 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,7 +1,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; -import { join } from "path"; import { logger } from "../../.."; +import * as path from "path"; /** * Find files or read contents present in the Repository. @@ -16,7 +16,7 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { if (!(file in this.contentCache)) { - this.existsCache[file] = await pathExists(join(this.cwd, file)); + this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } return this.existsCache[file]; @@ -26,20 +26,20 @@ export class RepositoryFileSystem implements FileSystem { } } - async read(path: string): Promise { - if (this.readErrorCache[path]) { - throw this.readErrorCache[path]; + async read(file: string): Promise { + if (this.readErrorCache[file]) { + throw this.readErrorCache[file]; } - if (!(path in this.contentCache)) { + if (!(file in this.contentCache)) { try { - const fileContents = await readFile(join(this.cwd, path), "utf-8"); - this.contentCache[path] = fileContents; + const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); + this.contentCache[file] = fileContents; } catch (error: any) { logger.error("Error occured while reading file contents:", error.message); throw error; } } - return this.contentCache[path]; + return this.contentCache[file]; } } diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index 639ea437652..c177451fab7 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -5,9 +5,7 @@ describe("RepositoryFileSystem", () => { let fileSystem: RepositoryFileSystem; before(() => { - fileSystem = new RepositoryFileSystem( - "/Users/svnsairam/Documents/google3/firebase-tools/src/frameworks/compose/discover/nodetestapp/nodeapp" - ); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/express"); }); describe("exists", () => { @@ -28,7 +26,23 @@ describe("RepositoryFileSystem", () => { it("should read and return the contents of the file", async () => { const fileContent = await fileSystem.read("package.json"); - expect(fileContent).to.equal(fileContent); + const expected = { + name: "express", + version: "1.0.0", + description: "", + main: "index.js", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + keywords: [], + author: "", + license: "ISC", + dependencies: { + express: "^4.18.2", + }, + }; + + expect(JSON.parse(fileContent)).to.deep.equal(expected); }); }); }); From 99c6687aaca4c536a814b0ddc3c7b0185fe4bec1 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:55:48 -0700 Subject: [PATCH 008/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 51e1525958a..bafe7fbc1a5 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,6 +15,9 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { + console.log("+++++++PPPPP+++++++++"); + console.log(path.resolve(this.cwd, file)); + console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From 3da93d6177f8b065c8b97a4dbae78cba4073953e Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:08:58 -0700 Subject: [PATCH 009/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index c177451fab7..cb4bc6c27a9 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -5,7 +5,7 @@ describe("RepositoryFileSystem", () => { let fileSystem: RepositoryFileSystem; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/express"); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); }); describe("exists", () => { From a0dd5b15091b7a140bcee9deb3a3904b183cd589 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:09:25 -0700 Subject: [PATCH 010/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index bafe7fbc1a5..51e1525958a 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,9 +15,6 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { - console.log("+++++++PPPPP+++++++++"); - console.log(path.resolve(this.cwd, file)); - console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From b856a709d71a24dc5743ef36d2bebb4293e12b57 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:30:50 -0700 Subject: [PATCH 011/104] Changes to filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 51e1525958a..010918a2b12 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -4,7 +4,7 @@ import { logger } from "../../.."; import * as path from "path"; /** - * Find files or read contents present in the Repository. + * Find files or read contents present in the Repository */ export class RepositoryFileSystem implements FileSystem { private readonly existsCache: Record = {}; From b3b8cca01aa92422775521ba9f476b51bf030ede Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:38:01 -0700 Subject: [PATCH 012/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index cb4bc6c27a9..f3185d7b88c 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -27,7 +27,7 @@ describe("RepositoryFileSystem", () => { const fileContent = await fileSystem.read("package.json"); const expected = { - name: "express", + name: "expressApp", version: "1.0.0", description: "", main: "index.js", From e56d9ad6142088e69ed1f2fe23c3d6ac9f1dfa3a Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:44:55 -0700 Subject: [PATCH 013/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index f3185d7b88c..610b19c435b 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -27,7 +27,7 @@ describe("RepositoryFileSystem", () => { const fileContent = await fileSystem.read("package.json"); const expected = { - name: "expressApp", + name: "expressapp", version: "1.0.0", description: "", main: "index.js", From 253700aa813091bd378d2a3eead74cf21907e924 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:01:17 -0700 Subject: [PATCH 014/104] Updated file system current working directory --- src/test/frameworks/compose/discover/frameworkMatcher.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index 99992612666..a91ff3c2dd2 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -14,7 +14,7 @@ describe("frameworkMatcher", () => { const NODE_ID = "nodejs"; before(() => { - fileSystem = new RepositoryFileSystem("./testapps/express"); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); }); describe("frameworkMatcher", () => { From c29a58d97fa63cb7cbe94f1cbe73000b1c06cec5 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:03:50 -0700 Subject: [PATCH 015/104] Changes to filesystem.spec.ts --- output.txt | 4156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4156 insertions(+) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 00000000000..11295634134 --- /dev/null +++ b/output.txt @@ -0,0 +1,4156 @@ + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (251ms) + ✔ should throw when rewrite points to function being deleted (87ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8552ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (74ms) + #url + ✔ should craft URL from host and port in registry (74ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (151ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (73ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + 2) should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 4) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (246ms) + ✔ should throw when executable not found (249ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (107ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (23s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) RepositoryFileSystem + read + should read and return the contents of the file: + + AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } + + expected - actual + + "description": "" + "keywords": [] + "license": "ISC" + "main": "index.js" + - "name": "expressapp" + + "name": "expressApp" + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } + "version": "1.0.0" + + at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 4) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.51 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From 89426da282dc964245953e592538bc23629a5aa6 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 11:01:51 -0700 Subject: [PATCH 016/104] Added code to test if correct frameworkSpec is recognized --- output.txt | 74571 ++++++++++++++++ .../compose/discover/frameworkMatcher.ts | 47 +- .../compose/discover/frameworkMatcher.spec.ts | 16 +- 3 files changed, 74607 insertions(+), 27 deletions(-) diff --git a/output.txt b/output.txt index 11295634134..29199f81741 100644 --- a/output.txt +++ b/output.txt @@ -4154,3 +4154,74574 @@ All files | 55.8 | 43.51 | 51.57 | 55.91 task-error.ts | 100 | 100 | 100 | 100 | timeout-error.ts | 100 | 100 | 100 | 100 | ---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (286ms) + ✔ should throw when rewrite points to function being deleted (123ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (84ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9113ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (115ms) + ✔ once stopped, an emulator is no longer running (476ms) + #url + ✔ should craft URL from host and port in registry (175ms) + ✔ should quote IPv6 addresses (134ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) + ✔ should use ::1 instead of :: (147ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (75ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 3) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (253ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (256ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (25s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 3) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.52 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (98ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9259ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (95ms) + ✔ once stopped, an emulator is no longer running (76ms) + #url + ✔ should craft URL from host and port in registry (79ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (154ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (267ms) + ✔ should throw when npm root not found (261ms) + ✔ should throw when executable not found (276ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (120ms) + ✔ creates a new typescript codebase with the correct configuration (117ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.53 | 51.53 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (102ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9239ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (107ms) + ✔ once stopped, an emulator is no longer running (83ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (164ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++PPPPPP+++++++++++ +[ true, true ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++PPPPPP+++++++++++ +[ false ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (259ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (265ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (220ms) + ✔ should throw when rewrite points to function being deleted (130ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9155ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (132ms) + ✔ once stopped, an emulator is no longer running (181ms) + #url + 2) should craft URL from host and port in registry + 3) should quote IPv6 addresses + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (148ms) + ✔ should use protocol from request if available (80ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++PPPP+++++++++ + 4) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [], + requiredFiles: [ [Array] ] + } +] +++++++++PPPP+++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (250ms) + ✔ should throw when executable not found (247ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (114ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (27s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should craft URL from host and port in registry: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) EmulatorRegistry + #url + should quote IPv6 addresses: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 4) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.54 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (362ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + 2) updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (88ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8595ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (158ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (254ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (252ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (124ms) + ✔ creates a new typescript codebase with the correct configuration (119ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (105ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (23s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: tenant management + updateTenants + updates tenant config: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.52 | 51.61 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (134ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (82ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9209ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (579ms) + ✔ once stopped, an emulator is no longer running (592ms) + #url + ✔ should craft URL from host and port in registry (458ms) + ✔ should quote IPv6 addresses (169ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) + ✔ should use ::1 instead of :: (741ms) + ✔ should use protocol from request if available (371ms) + ✔ should use host from request if available (101ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (257ms) + ✔ should throw when npm root not found (253ms) + ✔ should throw when executable not found (257ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (113ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (168ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (75ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8982ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (685ms) + ✔ once stopped, an emulator is no longer running (329ms) + #url + ✔ should craft URL from host and port in registry (89ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (152ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (124ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (248ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (223ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (87ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8904ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (101ms) + ✔ once stopped, an emulator is no longer running (82ms) + #url + ✔ should craft URL from host and port in registry (83ms) + ✔ should quote IPv6 addresses (85ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (258ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (127ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (77ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (112ms) + ✔ should throw when rewrite points to function being deleted (64ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8833ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (97ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (78ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (664ms) + ✔ should throw when npm root not found (321ms) + ✔ should throw when executable not found (336ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (49ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (256ms) + ✔ should throw when rewrite points to function being deleted (76ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8626ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (91ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (121ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (260ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (253ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (116ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (149ms) + ✔ should throw when rewrite points to function being deleted (63ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (90ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8882ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (86ms) + ✔ should quote IPv6 addresses (84ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (168ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (263ms) + ✔ should throw when npm root not found (255ms) + ✔ should throw when executable not found (263ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (122ms) + ✔ creates a new typescript codebase with the correct configuration (114ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (80ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled (38ms) + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (115ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9556ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (102ms) + ✔ once stopped, an emulator is no longer running (90ms) + #url + ✔ should craft URL from host and port in registry (84ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (165ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (81ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (517ms) + ✔ should throw when npm root not found (796ms) + ✔ should throw when executable not found (1834ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (121ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.85 | 43.53 | 51.61 | 55.96 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (129ms) + ✔ should throw when rewrite points to function being deleted (54ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + 2) should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (101ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10908ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (109ms) + ✔ once stopped, an emulator is no longer running (93ms) + #url + ✔ should craft URL from host and port in registry (92ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) + ✔ should use ::1 instead of :: (169ms) + ✔ should use protocol from request if available (85ms) + ✔ should use host from request if available (87ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (291ms) + ✔ should throw when npm root not found (364ms) + ✔ should throw when executable not found (769ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (131ms) + ✔ creates a new typescript codebase with the correct configuration (121ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (29s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: accounts:createAuthUri + should find user by either IDP email or 'top-level' email: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response (78ms) + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (302ms) + ✔ should throw when rewrite points to function being deleted (40ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (89ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10281ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (91ms) + ✔ once stopped, an emulator is no longer running (92ms) + #url + ✔ should craft URL from host and port in registry (91ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) + ✔ should use ::1 instead of :: (170ms) + ✔ should use protocol from request if available (92ms) + ✔ should use host from request if available (113ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (288ms) + ✔ should throw when npm root not found (280ms) + ✔ should throw when executable not found (288ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (142ms) + ✔ creates a new typescript codebase with the correct configuration (146ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (100ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (27s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8615ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (256ms) + ✔ once stopped, an emulator is no longer running (957ms) + #url + ✔ should craft URL from host and port in registry (893ms) + ✔ should quote IPv6 addresses (432ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (249ms) + ✔ should use protocol from request if available (102ms) + 2) should use host from request if available + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (139ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (255ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (105ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (26s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should use host from request if available: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (113ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8835ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (94ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (77ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (159ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (265ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (272ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (96ms) + ✔ should throw when rewrite points to function being deleted (59ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled (47ms) + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8923ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (80ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) + ✔ should use ::1 instead of :: (157ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] ++++++++EXPECT+++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} ++++++++ACTUAL+++++++ +Promise { } ++++++END+++++++ + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (260ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (104ms) + ✔ should throw when rewrite points to function being deleted (52ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (74ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8598ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (92ms) + ✔ once stopped, an emulator is no longer running (78ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + ✔ should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (258ms) + ✔ should throw when executable not found (250ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (113ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2542 passing (22s) + 4 pending + 1 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index 48b29d23a0f..3cb0ee0e17e 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -8,31 +8,40 @@ export function filterFrameworksWithDependencies( dependencies: Record ): FrameworkSpec[] { return allFrameworkSpecs.filter((framework) => { - return framework.requiredDependencies.every((dependency) => - dependencies.hasOwnProperty(dependency["name"]) - ); + return framework.requiredDependencies.every((dep) => { + return dep["name"] in dependencies; + }); }); } /** * */ -export function filterFrameworksWithFiles( +export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem -): FrameworkSpec[] { - return allFrameworkSpecs.filter((framework) => { +): Promise { + const filteredFrameworks = []; + for (const framework of allFrameworkSpecs) { if (!framework.requiredFiles) { - return true; + filteredFrameworks.push(framework); + continue; } - framework.requiredFiles.every((files) => { - if (Array.isArray(files)) { - return files.every((file) => fs.exists(file)); - } else { - return fs.exists(files); - } - }); - }); + const isRequired = await Promise.all( + framework.requiredFiles.map(async (files) => { + if (Array.isArray(files)) { + const boolArray = await Promise.all(files.map((file) => fs.exists(file))); + return boolArray.every((x) => x); + } else { + return await fs.exists(files); + } + }) + ); + if (isRequired.every((x) => x)) { + filteredFrameworks.push(framework); + } + } + return filteredFrameworks; } /** @@ -52,12 +61,12 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra /** * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. */ -export function frameworkMatcher( +export async function frameworkMatcher( runtime: string, fs: FileSystem, frameworks: FrameworkSpec[], dependencies: Record -): FrameworkSpec | null { +): Promise { try { // Filter based on runtime name. const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); @@ -67,11 +76,11 @@ export function frameworkMatcher( dependencies ); // Filter based on files required. - const frameworkWithFiles = filterFrameworksWithFiles(frameworksWithDependencies, fs); + const frameworkWithFiles = await filterFrameworksWithFiles(frameworksWithDependencies, fs); // Filter based on embeded Frameworks. const allMatches = removeEmbededFrameworks(frameworkWithFiles); - if (!allMatches.length) { + if (allMatches.length === 0) { return null; } if (allMatches.length > 1) { diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index a91ff3c2dd2..50c10ba7bb2 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -18,11 +18,11 @@ describe("frameworkMatcher", () => { }); describe("frameworkMatcher", () => { - it("should return express FrameworkSpec after analysing express application", () => { + it("should return express FrameworkSpec after analysing express application", async () => { const expressDependency: Record = { express: "^4.18.2", }; - const matchedFramework = frameworkMatcher( + const matchedFramework = await frameworkMatcher( NODE_ID, fileSystem, frameworkSpecs, @@ -39,7 +39,7 @@ describe("frameworkMatcher", () => { ], }; - expect(matchedFramework).to.equal(expressFrameworkSpec); + expect(matchedFramework).to.deep.equal(expressFrameworkSpec); }); }); @@ -83,28 +83,28 @@ describe("frameworkMatcher", () => { }); describe("filterFrameworksWithFiles", () => { - it("should return frameworks having all the required files", () => { + it("should return frameworks having all the required files", async () => { const allFrameworks: FrameworkSpec[] = [ { id: "express", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["package.json", "package-lock.json"], + requiredFiles: [["package.json", "package-lock.json"]], }, { id: "next", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["next.config.js", "next.config.ts"], + requiredFiles: [["next.config.js"], "next.config.ts"], }, ]; - const actual = filterFrameworksWithFiles(allFrameworks, fileSystem); + const actual = await filterFrameworksWithFiles(allFrameworks, fileSystem); const expected: FrameworkSpec[] = [ { id: "express", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["package.json", "package-lock.json"], + requiredFiles: [["package.json", "package-lock.json"]], }, ]; From 8b5474203842805328a002e365813b8fc4ee3b3c Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:30:49 -0700 Subject: [PATCH 017/104] Modified next commands --- src/frameworks/compose/discover/frameworkSpec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkSpec.ts b/src/frameworks/compose/discover/frameworkSpec.ts index 9b1422f5e7c..70655a85b07 100644 --- a/src/frameworks/compose/discover/frameworkSpec.ts +++ b/src/frameworks/compose/discover/frameworkSpec.ts @@ -23,14 +23,14 @@ export const frameworkSpecs: FrameworkSpec[] = [ ], commands: { build: { - cmd: "npx next build", + cmd: "next build", }, dev: { - cmd: "npx next dev", + cmd: "next dev", env: { NODE_ENV: "dev" }, }, run: { - cmd: "npx next run", + cmd: "next run", env: { NODE_ENV: "production" }, }, }, From e01a9af202792a48ce8ad4ab7ae546a113ad3b2c Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:36:58 -0700 Subject: [PATCH 018/104] Removed types which aren't focused at this time. --- src/frameworks/compose/discover/types.ts | 34 +++--------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts index b2e52414ce1..97fff3ea56c 100644 --- a/src/frameworks/compose/discover/types.ts +++ b/src/frameworks/compose/discover/types.ts @@ -13,7 +13,8 @@ export interface Command { // Consider: string[] for series of commands that must execute successfully // in sequence. cmd: string | string[]; - script?: string; + + // Environment in which command is executed. env?: Record; } @@ -26,11 +27,6 @@ export interface LifecycleCommands { export interface FrameworkSpec { id: string; - // This Framework is a refinement of the parent framework. It can only be - // selected when the parent's requirements are also met. If this framework - // matches, its scripts take precedence over the parent's scripts. - requireFramework?: string; - // Only analyze Frameworks with a runtime that matches the matched runtime runtime: string; @@ -38,11 +34,10 @@ export interface FrameworkSpec { // FrameworkSpec agree with one another webFrameworkId?: string; - // VSCode plugins that assist with writing a particular framework - suggestedPlugins?: string[]; - + // List of dependencies that should be present in the project. requiredDependencies: Array<{ name: string; + // Version semver?: string; }>; @@ -60,8 +55,6 @@ export interface FrameworkSpec { // can embed "svelte", so if both frameworks are discovered, monospace can // suggest both frameworks' plugins, but should run astro's commands. embedsFrameworks?: string[]; - - samples?: FrameworkSample[]; } export interface RuntimeSpec { @@ -84,23 +77,4 @@ export interface RuntimeSpec { // The runtime has detected a command that should always be run irrespective of // the framework (e.g. the "build" script always wins in Node) detectedCommands?: LifecycleCommands; - - fallbackCommands?: LifecycleCommands; -} - -export interface SampleInstallStrategy { - githubUrl: string; - command: string; -} - -export interface FrameworkSample { - name: string; - description: string; - icon: string; - - // oneof - install: SampleInstallStrategy; - - // e.g. "javascript" and "typescript" variants - installVariants: Record; } From 5db9a4e5c049e8c253c6f0eebdf94148c3893424 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:02:15 -0700 Subject: [PATCH 019/104] Added mockFileSystem for testing --- src/frameworks/compose/discover/filesystem.ts | 19 +- .../testapps/expressApp/package-lock.json | 604 ------------------ .../discover/testapps/expressApp/package.json | 15 - .../compose/discover/filesystem.spec.ts | 28 +- .../compose/discover/mockFileSystem.ts | 16 + 5 files changed, 41 insertions(+), 641 deletions(-) delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json create mode 100644 src/test/frameworks/compose/discover/mockFileSystem.ts diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 010918a2b12..db614ef5794 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,12 +1,12 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; -import { logger } from "../../.."; import * as path from "path"; +import { FirebaseError } from "../../../error"; /** - * Find files or read contents present in the Repository + * Find files or read file contents present in the directory. */ -export class RepositoryFileSystem implements FileSystem { +export class LocalFileSystem implements FileSystem { private readonly existsCache: Record = {}; private readonly contentCache: Record = {}; private readonly readErrorCache: Record = {}; @@ -20,9 +20,8 @@ export class RepositoryFileSystem implements FileSystem { } return this.existsCache[file]; - } catch (error: any) { - logger.error("Error occured while searching for file:", error.message); - throw error; + } catch (error) { + throw new FirebaseError("Error occured while searching for file."); } } @@ -34,9 +33,8 @@ export class RepositoryFileSystem implements FileSystem { try { const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); this.contentCache[file] = fileContents; - } catch (error: any) { - logger.error("Error occured while reading file contents:", error.message); - throw error; + } catch (error) { + throw new FirebaseError("Error occured while reading file contents."); } } return this.contentCache[file]; @@ -53,7 +51,6 @@ export async function readOrNull(fs: FileSystem, path: string): Promise= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json deleted file mode 100644 index 4ffc74a94ff..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index 610b19c435b..fac0de589fb 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,11 +1,22 @@ -import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; describe("RepositoryFileSystem", () => { - let fileSystem: RepositoryFileSystem; + let fileSystem: MockFileSystem; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); + fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + name: "expressapp", + version: "1.0.0", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + dependencies: { + express: "^4.18.2", + }, + }), + }); }); describe("exists", () => { @@ -26,23 +37,18 @@ describe("RepositoryFileSystem", () => { it("should read and return the contents of the file", async () => { const fileContent = await fileSystem.read("package.json"); - const expected = { + const expected = JSON.stringify({ name: "expressapp", version: "1.0.0", - description: "", - main: "index.js", scripts: { test: 'echo "Error: no test specified" && exit 1', }, - keywords: [], - author: "", - license: "ISC", dependencies: { express: "^4.18.2", }, - }; + }); - expect(JSON.parse(fileContent)).to.deep.equal(expected); + expect(fileContent).to.equal(expected); }); }); }); diff --git a/src/test/frameworks/compose/discover/mockFileSystem.ts b/src/test/frameworks/compose/discover/mockFileSystem.ts new file mode 100644 index 00000000000..6f1a1f5f0a6 --- /dev/null +++ b/src/test/frameworks/compose/discover/mockFileSystem.ts @@ -0,0 +1,16 @@ +import { FileSystem } from "../../../../frameworks/compose/discover/types"; + +export class MockFileSystem implements FileSystem { + constructor(private readonly mock: Record) {} + + exists(path: string): Promise { + return Promise.resolve(path in this.mock); + } + + read(path: string): Promise { + if (!(path in this.mock)) { + throw new Error("File not found in the mock file system."); + } + return Promise.resolve(this.mock[path]); + } +} From 132aa90275b528570514b6705395c9faacfed796 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:43:46 -0700 Subject: [PATCH 020/104] Added error handling --- src/frameworks/compose/discover/filesystem.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index db614ef5794..2e0f6b257c1 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -2,6 +2,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import * as path from "path"; import { FirebaseError } from "../../../error"; +import { logger } from "../../.."; /** * Find files or read file contents present in the directory. @@ -9,7 +10,6 @@ import { FirebaseError } from "../../../error"; export class LocalFileSystem implements FileSystem { private readonly existsCache: Record = {}; private readonly contentCache: Record = {}; - private readonly readErrorCache: Record = {}; constructor(private readonly cwd: string) {} @@ -26,18 +26,16 @@ export class LocalFileSystem implements FileSystem { } async read(file: string): Promise { - if (this.readErrorCache[file]) { - throw this.readErrorCache[file]; - } - if (!(file in this.contentCache)) { - try { + try { + if (!(file in this.contentCache)) { const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); this.contentCache[file] = fileContents; - } catch (error) { - throw new FirebaseError("Error occured while reading file contents."); } + return this.contentCache[file]; + } catch (error) { + logger.log("Error occured while reading file contents."); + throw error; } - return this.contentCache[file]; } } From 6a018dd85e9476f71f4ffe4dfc60b8e143229330 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:38:28 -0700 Subject: [PATCH 021/104] Resolved code comments --- output.txt | 78727 ---------------- .../compose/discover/frameworkMatcher.ts | 95 +- .../compose/discover/frameworkMatcher.spec.ts | 18 +- 3 files changed, 65 insertions(+), 78775 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index 29199f81741..00000000000 --- a/output.txt +++ /dev/null @@ -1,78727 +0,0 @@ - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (251ms) - ✔ should throw when rewrite points to function being deleted (87ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8552ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (74ms) - #url - ✔ should craft URL from host and port in registry (74ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (151ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (73ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - 2) should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 4) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (246ms) - ✔ should throw when executable not found (249ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (107ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (23s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) RepositoryFileSystem - read - should read and return the contents of the file: - - AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } - + expected - actual - - "description": "" - "keywords": [] - "license": "ISC" - "main": "index.js" - - "name": "expressapp" - + "name": "expressApp" - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - } - "version": "1.0.0" - - at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 4) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.51 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (286ms) - ✔ should throw when rewrite points to function being deleted (123ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (84ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9113ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (115ms) - ✔ once stopped, an emulator is no longer running (476ms) - #url - ✔ should craft URL from host and port in registry (175ms) - ✔ should quote IPv6 addresses (134ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) - ✔ should use ::1 instead of :: (147ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (75ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 3) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (253ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (256ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (25s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 3) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.52 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (98ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9259ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (95ms) - ✔ once stopped, an emulator is no longer running (76ms) - #url - ✔ should craft URL from host and port in registry (79ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (154ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (267ms) - ✔ should throw when npm root not found (261ms) - ✔ should throw when executable not found (276ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (120ms) - ✔ creates a new typescript codebase with the correct configuration (117ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.53 | 51.53 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (102ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9239ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (107ms) - ✔ once stopped, an emulator is no longer running (83ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (164ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++PPPPPP+++++++++++ -[ true, true ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++PPPPPP+++++++++++ -[ false ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (259ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (265ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (220ms) - ✔ should throw when rewrite points to function being deleted (130ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9155ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (132ms) - ✔ once stopped, an emulator is no longer running (181ms) - #url - 2) should craft URL from host and port in registry - 3) should quote IPv6 addresses - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (148ms) - ✔ should use protocol from request if available (80ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++PPPP+++++++++ - 4) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [], - requiredFiles: [ [Array] ] - } -] -++++++++PPPP+++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (250ms) - ✔ should throw when executable not found (247ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (114ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (27s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should craft URL from host and port in registry: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) EmulatorRegistry - #url - should quote IPv6 addresses: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 4) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.54 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (362ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - 2) updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (88ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8595ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (158ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (254ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (252ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (124ms) - ✔ creates a new typescript codebase with the correct configuration (119ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (105ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (23s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: tenant management - updateTenants - updates tenant config: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.52 | 51.61 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (134ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (82ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9209ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (579ms) - ✔ once stopped, an emulator is no longer running (592ms) - #url - ✔ should craft URL from host and port in registry (458ms) - ✔ should quote IPv6 addresses (169ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) - ✔ should use ::1 instead of :: (741ms) - ✔ should use protocol from request if available (371ms) - ✔ should use host from request if available (101ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (257ms) - ✔ should throw when npm root not found (253ms) - ✔ should throw when executable not found (257ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (113ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (168ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (75ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8982ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (685ms) - ✔ once stopped, an emulator is no longer running (329ms) - #url - ✔ should craft URL from host and port in registry (89ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (152ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (124ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (248ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (223ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (87ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8904ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (101ms) - ✔ once stopped, an emulator is no longer running (82ms) - #url - ✔ should craft URL from host and port in registry (83ms) - ✔ should quote IPv6 addresses (85ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (258ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (127ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (77ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (112ms) - ✔ should throw when rewrite points to function being deleted (64ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8833ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (97ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (78ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (664ms) - ✔ should throw when npm root not found (321ms) - ✔ should throw when executable not found (336ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (49ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (256ms) - ✔ should throw when rewrite points to function being deleted (76ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8626ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (91ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (121ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (260ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (253ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (116ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (149ms) - ✔ should throw when rewrite points to function being deleted (63ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (90ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8882ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (86ms) - ✔ should quote IPv6 addresses (84ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (168ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (263ms) - ✔ should throw when npm root not found (255ms) - ✔ should throw when executable not found (263ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (122ms) - ✔ creates a new typescript codebase with the correct configuration (114ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (80ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled (38ms) - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (115ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9556ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (102ms) - ✔ once stopped, an emulator is no longer running (90ms) - #url - ✔ should craft URL from host and port in registry (84ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (165ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (81ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (517ms) - ✔ should throw when npm root not found (796ms) - ✔ should throw when executable not found (1834ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (121ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.85 | 43.53 | 51.61 | 55.96 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (129ms) - ✔ should throw when rewrite points to function being deleted (54ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - 2) should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (101ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10908ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (109ms) - ✔ once stopped, an emulator is no longer running (93ms) - #url - ✔ should craft URL from host and port in registry (92ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) - ✔ should use ::1 instead of :: (169ms) - ✔ should use protocol from request if available (85ms) - ✔ should use host from request if available (87ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (291ms) - ✔ should throw when npm root not found (364ms) - ✔ should throw when executable not found (769ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (131ms) - ✔ creates a new typescript codebase with the correct configuration (121ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (29s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: accounts:createAuthUri - should find user by either IDP email or 'top-level' email: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response (78ms) - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (302ms) - ✔ should throw when rewrite points to function being deleted (40ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (89ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10281ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (91ms) - ✔ once stopped, an emulator is no longer running (92ms) - #url - ✔ should craft URL from host and port in registry (91ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) - ✔ should use ::1 instead of :: (170ms) - ✔ should use protocol from request if available (92ms) - ✔ should use host from request if available (113ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (288ms) - ✔ should throw when npm root not found (280ms) - ✔ should throw when executable not found (288ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (142ms) - ✔ creates a new typescript codebase with the correct configuration (146ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (100ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (27s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8615ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (256ms) - ✔ once stopped, an emulator is no longer running (957ms) - #url - ✔ should craft URL from host and port in registry (893ms) - ✔ should quote IPv6 addresses (432ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (249ms) - ✔ should use protocol from request if available (102ms) - 2) should use host from request if available - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (139ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (255ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (105ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (26s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should use host from request if available: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (113ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8835ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (94ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (77ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (159ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (265ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (272ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (96ms) - ✔ should throw when rewrite points to function being deleted (59ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled (47ms) - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8923ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (80ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) - ✔ should use ::1 instead of :: (157ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -+++++++EXPECT+++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} -+++++++ACTUAL+++++++ -Promise { } -+++++END+++++++ - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (260ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (104ms) - ✔ should throw when rewrite points to function being deleted (52ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (74ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8598ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (92ms) - ✔ once stopped, an emulator is no longer running (78ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - ✔ should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (258ms) - ✔ should throw when executable not found (250ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (113ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2542 passing (22s) - 4 pending - 1 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index 3cb0ee0e17e..cc5c99af377 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -1,65 +1,74 @@ +import { logger } from "../../.."; +import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; -/** - * - */ export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], dependencies: Record ): FrameworkSpec[] { - return allFrameworkSpecs.filter((framework) => { - return framework.requiredDependencies.every((dep) => { - return dep["name"] in dependencies; + try { + return allFrameworkSpecs.filter((framework) => { + return framework.requiredDependencies.every((dependency) => { + return dependency.name in dependencies; + }); }); - }); + } catch (error: any) { + logger.log("Error while filtering FrameworksWithDependencies", error.message); + throw error; + } } -/** - * - */ export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem ): Promise { - const filteredFrameworks = []; - for (const framework of allFrameworkSpecs) { - if (!framework.requiredFiles) { - filteredFrameworks.push(framework); - continue; - } - const isRequired = await Promise.all( - framework.requiredFiles.map(async (files) => { + try { + const filteredFrameworks = []; + for (const framework of allFrameworkSpecs) { + if (!framework.requiredFiles) { + filteredFrameworks.push(framework); + continue; + } + let isRequired = true; + for (const files of framework.requiredFiles) { if (Array.isArray(files)) { - const boolArray = await Promise.all(files.map((file) => fs.exists(file))); - return boolArray.every((x) => x); + for (const file of files) { + isRequired = isRequired && (await fs.exists(file)); + } } else { - return await fs.exists(files); + isRequired = isRequired && (await fs.exists(files)); } - }) - ); - if (isRequired.every((x) => x)) { - filteredFrameworks.push(framework); + } + + if (isRequired) { + filteredFrameworks.push(framework); + } } + return filteredFrameworks; + } catch (error: any) { + logger.log("Error while filtering FrameworksWithFiles", error.message); + throw error; } - return filteredFrameworks; } -/** - * - */ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { - const embededFrameworkSet: Set = new Set(); - allFrameworkSpecs.forEach((framework) => { - if (!framework.embedsFrameworks) { - return; - } - framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); - }); - return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); + try { + const embededFrameworkSet: Set = new Set(); + allFrameworkSpecs.forEach((framework) => { + if (!framework.embedsFrameworks) { + return; + } + framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); + }); + return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); + } catch (error: any) { + logger.log("Error occured while removing Embeded Frameworks", error.message); + throw error; + } } /** - * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. + * Identifies the correct FrameworkSpec for the codebase. */ export async function frameworkMatcher( runtime: string, @@ -68,16 +77,12 @@ export async function frameworkMatcher( dependencies: Record ): Promise { try { - // Filter based on runtime name. const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); - // Filter based on dependencies. const frameworksWithDependencies = filterFrameworksWithDependencies( filterRuntimeFramework, dependencies ); - // Filter based on files required. const frameworkWithFiles = await filterFrameworksWithFiles(frameworksWithDependencies, fs); - // Filter based on embeded Frameworks. const allMatches = removeEmbededFrameworks(frameworkWithFiles); if (allMatches.length === 0) { @@ -85,11 +90,11 @@ export async function frameworkMatcher( } if (allMatches.length > 1) { const frameworkNames = allMatches.map((framework) => framework.id); - throw new Error(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + throw new FirebaseError(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); } return allMatches[0]; - } catch (error: any) { - throw new Error("Failed to match the correct frameworkSpec", error.message); + } catch (error) { + throw new FirebaseError("Failed to match the correct frameworkSpec"); } } diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index 50c10ba7bb2..60ce9c6997c 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -1,4 +1,4 @@ -import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; import { frameworkMatcher, @@ -10,11 +10,23 @@ import { frameworkSpecs } from "../../../../frameworks/compose/discover/framewor import { FrameworkSpec } from "../../../../frameworks/compose/discover/types"; describe("frameworkMatcher", () => { - let fileSystem: RepositoryFileSystem; + let fileSystem: MockFileSystem; const NODE_ID = "nodejs"; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); + fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + name: "expressapp", + version: "1.0.0", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + dependencies: { + express: "^4.18.2", + }, + }), + "package-lock.json": "Unused: contents of package-lock file", + }); }); describe("frameworkMatcher", () => { From e6fb8377ba32a2e985b4461abc52c46fe5c867d5 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:58:13 -0700 Subject: [PATCH 022/104] Removed lint errors --- .../compose/discover/frameworkMatcher.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index cc5c99af377..e8bb394fc11 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -1,6 +1,6 @@ -import { logger } from "../../.."; import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; +import { logger } from "../../../logger"; export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], @@ -12,8 +12,8 @@ export function filterFrameworksWithDependencies( return dependency.name in dependencies; }); }); - } catch (error: any) { - logger.log("Error while filtering FrameworksWithDependencies", error.message); + } catch (error) { + logger.error("Error while filtering FrameworksWithDependencies", error); throw error; } } @@ -45,8 +45,8 @@ export async function filterFrameworksWithFiles( } } return filteredFrameworks; - } catch (error: any) { - logger.log("Error while filtering FrameworksWithFiles", error.message); + } catch (error) { + logger.error("Error while filtering FrameworksWithFiles", error); throw error; } } @@ -61,8 +61,8 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); }); return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); - } catch (error: any) { - logger.log("Error occured while removing Embeded Frameworks", error.message); + } catch (error) { + logger.error("Error occured while removing Embeded Frameworks", error.message); throw error; } } From 02821afbf2580af73dcd2d36f04a93610a6a377c Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 16:00:34 -0700 Subject: [PATCH 023/104] Removed lint errors --- src/frameworks/compose/discover/frameworkMatcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index e8bb394fc11..b8f6b63cd56 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -62,7 +62,7 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra }); return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); } catch (error) { - logger.error("Error occured while removing Embeded Frameworks", error.message); + logger.error("Error occured while removing Embeded Frameworks", error); throw error; } } From 886c73aa8f1b599dfb665370be6ba792ae6750fa Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:29:02 -0700 Subject: [PATCH 024/104] changes to desription name --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index fac0de589fb..b0faf491231 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,7 +1,7 @@ import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; -describe("RepositoryFileSystem", () => { +describe("LocalFileSystem", () => { let fileSystem: MockFileSystem; before(() => { From ba47e79cf7f5291819ac29935584f9021a376ade Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:00:42 -0700 Subject: [PATCH 025/104] Resolved error handling and test cases changes --- src/frameworks/compose/discover/filesystem.ts | 13 ++++---- .../compose/discover/filesystem.spec.ts | 8 +++-- .../compose/discover/mockFileSystem.ts | 32 ++++++++++++++++--- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 2e0f6b257c1..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -2,7 +2,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import * as path from "path"; import { FirebaseError } from "../../../error"; -import { logger } from "../../.."; +import { logger } from "../../../../src/logger"; /** * Find files or read file contents present in the directory. @@ -21,7 +21,7 @@ export class LocalFileSystem implements FileSystem { return this.existsCache[file]; } catch (error) { - throw new FirebaseError("Error occured while searching for file."); + throw new FirebaseError(`Error occured while searching for file: ${error}`); } } @@ -33,7 +33,7 @@ export class LocalFileSystem implements FileSystem { } return this.contentCache[file]; } catch (error) { - logger.log("Error occured while reading file contents."); + logger.error("Error occured while reading file contents."); throw error; } } @@ -45,10 +45,11 @@ export class LocalFileSystem implements FileSystem { export async function readOrNull(fs: FileSystem, path: string): Promise { try { return fs.read(path); - } catch (err: unknown) { - if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") { + } catch (err: any) { + if (err && typeof err === "object" && err?.code === "ENOENT") { + logger.debug("ENOENT error occured while reading file."); return null; } - throw new FirebaseError("Unknown error occured while trying to read file contents."); + throw new Error(`Unknown error occured while reading file: ${err}`); } } diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index b0faf491231..db1212b3393 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,7 +1,7 @@ import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; -describe("LocalFileSystem", () => { +describe("MockFileSystem", () => { let fileSystem: MockFileSystem; before(() => { @@ -23,13 +23,14 @@ describe("LocalFileSystem", () => { it("should return true if file exists in the directory ", async () => { const fileExists = await fileSystem.exists("package.json"); - expect(fileExists).to.equal(true); + expect(fileExists).to.be.true; + expect(fileSystem.getExistsCache("package.json")).to.be.true; }); it("should return false if file does not exist in the directory", async () => { const fileExists = await fileSystem.exists("nonexistent.txt"); - expect(fileExists).to.equal(false); + expect(fileExists).to.be.false; }); }); @@ -49,6 +50,7 @@ describe("LocalFileSystem", () => { }); expect(fileContent).to.equal(expected); + expect(fileSystem.getContentCache("package.json")).to.equal(expected); }); }); }); diff --git a/src/test/frameworks/compose/discover/mockFileSystem.ts b/src/test/frameworks/compose/discover/mockFileSystem.ts index 6f1a1f5f0a6..cdbf21d6159 100644 --- a/src/test/frameworks/compose/discover/mockFileSystem.ts +++ b/src/test/frameworks/compose/discover/mockFileSystem.ts @@ -1,16 +1,38 @@ import { FileSystem } from "../../../../frameworks/compose/discover/types"; export class MockFileSystem implements FileSystem { - constructor(private readonly mock: Record) {} + private readonly existsCache: Record = {}; + private readonly contentCache: Record = {}; + + constructor(private readonly fileSys: Record) {} exists(path: string): Promise { - return Promise.resolve(path in this.mock); + if (!(path in this.existsCache)) { + this.existsCache[path] = path in this.fileSys; + } + + return Promise.resolve(this.existsCache[path]); } read(path: string): Promise { - if (!(path in this.mock)) { - throw new Error("File not found in the mock file system."); + if (!(path in this.contentCache)) { + if (!(path in this.fileSys)) { + const err = new Error("File path not found"); + err.cause = "ENOENT"; + throw err; + } else { + this.contentCache[path] = this.fileSys[path]; + } } - return Promise.resolve(this.mock[path]); + + return Promise.resolve(this.contentCache[path]); + } + + getContentCache(path: string): string { + return this.contentCache[path]; + } + + getExistsCache(path: string): boolean { + return this.existsCache[path]; } } From 373547a643d075acddd2f7ab14afbdccc6441f61 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:16:14 -0700 Subject: [PATCH 026/104] Resolved comments --- src/frameworks/compose/discover/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts index 97fff3ea56c..677e054ec27 100644 --- a/src/frameworks/compose/discover/types.ts +++ b/src/frameworks/compose/discover/types.ts @@ -12,7 +12,7 @@ export interface Runtime { export interface Command { // Consider: string[] for series of commands that must execute successfully // in sequence. - cmd: string | string[]; + cmd: string; // Environment in which command is executed. env?: Record; From d4d1a6e5a20dd4945a7cc34f744cf721979472d2 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:23:41 -0700 Subject: [PATCH 027/104] Error handling changes --- src/frameworks/compose/discover/frameworkMatcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index b8f6b63cd56..b9c43d7f1f6 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -94,7 +94,7 @@ export async function frameworkMatcher( } return allMatches[0]; - } catch (error) { - throw new FirebaseError("Failed to match the correct frameworkSpec"); + } catch (error: any) { + throw new FirebaseError(`Failed to match the correct frameworkSpec: ${error}`); } } From 29fa655e98102d27f4f2932b4b98ed6e61b9e0c1 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 11:53:53 -0700 Subject: [PATCH 028/104] Resolved comments --- .../compose/discover/frameworkMatcher.ts | 65 ++++++++++--------- .../compose/discover/frameworkMatcher.spec.ts | 30 +++++++++ 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index b9c43d7f1f6..a7a1968e2fb 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -6,16 +6,11 @@ export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], dependencies: Record ): FrameworkSpec[] { - try { - return allFrameworkSpecs.filter((framework) => { - return framework.requiredDependencies.every((dependency) => { - return dependency.name in dependencies; - }); + return allFrameworkSpecs.filter((framework) => { + return framework.requiredDependencies.every((dependency) => { + return dependency.name in dependencies; }); - } catch (error) { - logger.error("Error while filtering FrameworksWithDependencies", error); - throw error; - } + }); } export async function filterFrameworksWithFiles( @@ -30,41 +25,43 @@ export async function filterFrameworksWithFiles( continue; } let isRequired = true; - for (const files of framework.requiredFiles) { - if (Array.isArray(files)) { - for (const file of files) { - isRequired = isRequired && (await fs.exists(file)); + for (let files of framework.requiredFiles) { + files = Array.isArray(files) ? files : [files]; + for (const file of files) { + isRequired = isRequired && (await fs.exists(file)); + if (!isRequired) { + break; } - } else { - isRequired = isRequired && (await fs.exists(files)); } } - if (isRequired) { filteredFrameworks.push(framework); } } + return filteredFrameworks; } catch (error) { - logger.error("Error while filtering FrameworksWithFiles", error); + logger.error("Error: Unable to filter frameworks based on required files", error); throw error; } } +/** + * Embeded frameworks help to resolve tiebreakers when multiple frameworks are discovered. + * Ex: "next" embeds "react", so if both frameworks are discovered, + * we can suggest "next" commands by removing embeded framework(react). + */ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { - try { - const embededFrameworkSet: Set = new Set(); - allFrameworkSpecs.forEach((framework) => { - if (!framework.embedsFrameworks) { - return; - } - framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); - }); - return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); - } catch (error) { - logger.error("Error occured while removing Embeded Frameworks", error); - throw error; - } + const embededFrameworkSet: Set = new Set(); + + allFrameworkSpecs.forEach((framework) => { + if (!framework.embedsFrameworks) { + return; + } + framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); + }); + + return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); } /** @@ -90,11 +87,15 @@ export async function frameworkMatcher( } if (allMatches.length > 1) { const frameworkNames = allMatches.map((framework) => framework.id); - throw new FirebaseError(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + throw new FirebaseError( + `Multiple Frameworks are matched: ${frameworkNames.join( + ", " + )} Manually set up override commands in firebase.json` + ); } return allMatches[0]; } catch (error: any) { - throw new FirebaseError(`Failed to match the correct frameworkSpec: ${error}`); + throw new FirebaseError(`Failed to match the correct framework: ${error}`); } } diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index 60ce9c6997c..aa6c9823f52 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -89,8 +89,16 @@ describe("frameworkMatcher", () => { embedsFrameworks: ["react"], }, ]; + const notExpect: FrameworkSpec[] = [ + { + id: "react", + runtime: "nodejs", + requiredDependencies: [], + }, + ]; expect(actual).to.have.deep.members(expected); + expect(actual).to.not.have.deep.members(notExpect); }); }); @@ -120,7 +128,17 @@ describe("frameworkMatcher", () => { }, ]; + const notExpect: FrameworkSpec[] = [ + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: [["next.config.js"], "next.config.ts"], + }, + ]; + expect(actual).to.have.deep.members(expected); + expect(actual).to.not.have.members(notExpect); }); }); @@ -161,8 +179,20 @@ describe("frameworkMatcher", () => { ], }, ]; + const notExpect: FrameworkSpec[] = [ + { + id: "next", + runtime: "nodejs", + requiredDependencies: [ + { + name: "next", + }, + ], + }, + ]; expect(actual).to.have.deep.members(expected); + expect(actual).to.not.have.deep.members(notExpect); }); }); }); From 30eb4db3c6acea6c238bc3047f9d6b141ab79342 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 16:09:13 -0700 Subject: [PATCH 029/104] Added frameworkSpec and different types used for discoving frameworks --- .../compose/discover/frameworkSpec.ts | 38 +++++++ src/frameworks/compose/discover/types.ts | 106 ++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 src/frameworks/compose/discover/frameworkSpec.ts create mode 100644 src/frameworks/compose/discover/types.ts diff --git a/src/frameworks/compose/discover/frameworkSpec.ts b/src/frameworks/compose/discover/frameworkSpec.ts new file mode 100644 index 00000000000..09c1230a372 --- /dev/null +++ b/src/frameworks/compose/discover/frameworkSpec.ts @@ -0,0 +1,38 @@ +import { FrameworkSpec } from "./types"; + +export const frameworkSpecs: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + webFrameworkId: "Express.js", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + { + id: "nextjs", + runtime: "nodejs", + webFrameworkId: "Next.js", + requiredFiles: ["next.config.js", "next.config.ts"], + requiredDependencies: [ + { + name: "next", + }, + ], + commands: { + build: { + cmd: "npx next build", + }, + dev: { + cmd: "npx next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "npx next run", + env: { NODE_ENV: "production" }, + }, + }, + }, +]; \ No newline at end of file diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts new file mode 100644 index 00000000000..52a6869057a --- /dev/null +++ b/src/frameworks/compose/discover/types.ts @@ -0,0 +1,106 @@ +export interface FileSystem { + exists(file: string): Promise; + read(file: string): Promise; + } + + export interface Runtime { + match(fs: FileSystem): Promise; + getRuntimeName(): string; + analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; + } + + export interface Command { + // Consider: string[] for series of commands that must execute successfully + // in sequence. + cmd: string | string[]; + script?:string; + env?: Record; + } + + export interface LifecycleCommands { + build?: Command; + run?: Command; + dev?: Command; + } + + export interface FrameworkSpec { + id: string; + + // This Framework is a refinement of the parent framework. It can only be + // selected when the parent's requirements are also met. If this framework + // matches, its scripts take precedence over the parent's scripts. + requireFramework?: string; + + // Only analyze Frameworks with a runtime that matches the matched runtime + runtime: string; + + // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the + // FrameworkSpec agree with one another + webFrameworkId?: string; + + // VSCode plugins that assist with writing a particular framework + suggestedPlugins?: string[]; + + requiredDependencies: Array<{ + name: string; + semver?: string; + }>; + + // If a requiredFiles is an array, then one of the files in the array must match. + // This supports, for example, a file that can be a js, ts, or mjs file. + requiredFiles?: Array; + + // Any commands that this framework needs that are not standard for the + // runtime. Often times, this can be empty (e.g. depend on npm run build and + // npm run start) + commands?: LifecycleCommands; + + // We must resolve to a single framework when getting build/dev/run commands. + // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" + // can embed "svelte", so if both frameworks are discovered, monospace can + // suggest both frameworks' plugins, but should run astro's commands. + embedsFrameworks?: string[]; + + samples?: FrameworkSample[]; + } + + export interface RuntimeSpec { + // e.g. `nodejs` + id: string; + + // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) + baseImage: string; + + // e.g. `npm install yarn typescript` + packageManagerInstallCommand?: string; + + // e.g. `npm ci`, `npm install`, `yarn` + installCommand?: string; + + // Commands to run right before exporting the container image + // e.g. npm prune --omit=dev, yarn install --production=true + exportCommands?: string[]; + + // The runtime has detected a command that should always be run irrespective of + // the framework (e.g. the "build" script always wins in Node) + detectedCommands?: LifecycleCommands; + + fallbackCommands?: LifecycleCommands; + } + + export interface SampleInstallStrategy { + githubUrl: string; + command: string; + } + + export interface FrameworkSample { + name: string; + description: string; + icon: string; + + // oneof + install: SampleInstallStrategy; + + // e.g. "javascript" and "typescript" variants + installVariants: Record; + } \ No newline at end of file From ca0ead104e4679e50c2bcb094162983c8e1671bc Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 16:44:02 -0700 Subject: [PATCH 030/104] Added repository file system to check if file exists and to read file contents --- src/frameworks/compose/discover/filesystem.ts | 58 +++++++++++++++++++ .../compose/discover/filesystem.spec.ts | 34 +++++++++++ 2 files changed, 92 insertions(+) create mode 100644 src/frameworks/compose/discover/filesystem.ts create mode 100644 src/test/frameworks/compose/discover/filesystem.spec.ts diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts new file mode 100644 index 00000000000..279628cfe84 --- /dev/null +++ b/src/frameworks/compose/discover/filesystem.ts @@ -0,0 +1,58 @@ +import { FileSystem } from "./types"; +import { pathExists, readFile } from "fs-extra"; +import { join } from "path"; + +/** + * Find or read contents present in the Repository. + */ +export class RepositoryFileSystem implements FileSystem { + private readonly existsCache: Record = {}; + private readonly contentCache: Record = {}; + private readonly readErrorCache: Record = {}; + + constructor(private readonly cwd: string) {} + + async exists(file: string): Promise { + try { + if (!(file in this.contentCache)) { + // Get repository contents + this.existsCache[file] = await pathExists(join(this.cwd, file)); + } + + return this.existsCache[file]; + } catch (error: any) { + // File not found + console.error("Error occured while searching for file:", error.message); + return Promise.resolve(false); + } + } + + async read(path: string): Promise { + if (this.readErrorCache[path]) { + throw this.readErrorCache[path]; + } + if (!(path in this.contentCache)) { + try { + const fileContents = await readFile(join(this.cwd, path), "utf-8"); + this.contentCache[path] = fileContents; + } catch (error: any) { + new Error("Can't read file contents."); + } + } + return this.contentCache[path]; + } +} + +/** + * Convert ENOENT errors into null + */ +export async function readOrNull(fs: FileSystem, path: string): Promise { + try { + return fs.read(path); + } catch (err: unknown) { + if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") { + return null; + } + throw err; + } +} \ No newline at end of file diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts new file mode 100644 index 00000000000..639ea437652 --- /dev/null +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -0,0 +1,34 @@ +import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { expect } from "chai"; + +describe("RepositoryFileSystem", () => { + let fileSystem: RepositoryFileSystem; + + before(() => { + fileSystem = new RepositoryFileSystem( + "/Users/svnsairam/Documents/google3/firebase-tools/src/frameworks/compose/discover/nodetestapp/nodeapp" + ); + }); + + describe("exists", () => { + it("should return true if file exists in the directory ", async () => { + const fileExists = await fileSystem.exists("package.json"); + + expect(fileExists).to.equal(true); + }); + + it("should return false if file does not exist in the directory", async () => { + const fileExists = await fileSystem.exists("nonexistent.txt"); + + expect(fileExists).to.equal(false); + }); + }); + + describe("read", () => { + it("should read and return the contents of the file", async () => { + const fileContent = await fileSystem.read("package.json"); + + expect(fileContent).to.equal(fileContent); + }); + }); +}); From 48063902cde4ef11e64f07c5baf79d4634f831fa Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:28:37 -0700 Subject: [PATCH 031/104] Removed comments and modified error handling. --- src/frameworks/compose/discover/filesystem.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 279628cfe84..f5a4404f177 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,9 +1,10 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import { join } from "path"; +import { logger } from "../../.."; /** - * Find or read contents present in the Repository. + * Find files or read contents present in the Repository. */ export class RepositoryFileSystem implements FileSystem { private readonly existsCache: Record = {}; @@ -15,15 +16,13 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { if (!(file in this.contentCache)) { - // Get repository contents this.existsCache[file] = await pathExists(join(this.cwd, file)); } return this.existsCache[file]; } catch (error: any) { - // File not found - console.error("Error occured while searching for file:", error.message); - return Promise.resolve(false); + logger.error("Error occured while searching for file:", error.message); + throw error; } } @@ -36,7 +35,8 @@ export class RepositoryFileSystem implements FileSystem { const fileContents = await readFile(join(this.cwd, path), "utf-8"); this.contentCache[path] = fileContents; } catch (error: any) { - new Error("Can't read file contents."); + logger.error("Error occured while reading file contents:", error.message); + throw error; } } return this.contentCache[path]; @@ -53,6 +53,7 @@ export async function readOrNull(fs: FileSystem, path: string): Promise Date: Thu, 8 Jun 2023 18:00:25 -0700 Subject: [PATCH 032/104] Resolved indentation issues --- src/frameworks/compose/discover/filesystem.ts | 2 +- .../compose/discover/frameworkSpec.ts | 2 +- src/frameworks/compose/discover/types.ts | 208 +++++++++--------- 3 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index f5a4404f177..298ab8279d4 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -56,4 +56,4 @@ export async function readOrNull(fs: FileSystem, path: string): Promise; - read(file: string): Promise; - } - - export interface Runtime { - match(fs: FileSystem): Promise; - getRuntimeName(): string; - analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; - } - - export interface Command { - // Consider: string[] for series of commands that must execute successfully - // in sequence. - cmd: string | string[]; - script?:string; - env?: Record; - } - - export interface LifecycleCommands { - build?: Command; - run?: Command; - dev?: Command; - } - - export interface FrameworkSpec { - id: string; - - // This Framework is a refinement of the parent framework. It can only be - // selected when the parent's requirements are also met. If this framework - // matches, its scripts take precedence over the parent's scripts. - requireFramework?: string; - - // Only analyze Frameworks with a runtime that matches the matched runtime - runtime: string; - - // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the - // FrameworkSpec agree with one another - webFrameworkId?: string; - - // VSCode plugins that assist with writing a particular framework - suggestedPlugins?: string[]; - - requiredDependencies: Array<{ - name: string; - semver?: string; - }>; - - // If a requiredFiles is an array, then one of the files in the array must match. - // This supports, for example, a file that can be a js, ts, or mjs file. - requiredFiles?: Array; - - // Any commands that this framework needs that are not standard for the - // runtime. Often times, this can be empty (e.g. depend on npm run build and - // npm run start) - commands?: LifecycleCommands; - - // We must resolve to a single framework when getting build/dev/run commands. - // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" - // can embed "svelte", so if both frameworks are discovered, monospace can - // suggest both frameworks' plugins, but should run astro's commands. - embedsFrameworks?: string[]; - - samples?: FrameworkSample[]; - } - - export interface RuntimeSpec { - // e.g. `nodejs` - id: string; - - // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) - baseImage: string; - - // e.g. `npm install yarn typescript` - packageManagerInstallCommand?: string; - - // e.g. `npm ci`, `npm install`, `yarn` - installCommand?: string; - - // Commands to run right before exporting the container image - // e.g. npm prune --omit=dev, yarn install --production=true - exportCommands?: string[]; - - // The runtime has detected a command that should always be run irrespective of - // the framework (e.g. the "build" script always wins in Node) - detectedCommands?: LifecycleCommands; - - fallbackCommands?: LifecycleCommands; - } - - export interface SampleInstallStrategy { - githubUrl: string; - command: string; - } - - export interface FrameworkSample { + exists(file: string): Promise; + read(file: string): Promise; +} + +export interface Runtime { + match(fs: FileSystem): Promise; + getRuntimeName(): string; + analyseCodebase(fs: FileSystem, allFrameworkSpecs: FrameworkSpec[]): Promise; +} + +export interface Command { + // Consider: string[] for series of commands that must execute successfully + // in sequence. + cmd: string | string[]; + script?: string; + env?: Record; +} + +export interface LifecycleCommands { + build?: Command; + run?: Command; + dev?: Command; +} + +export interface FrameworkSpec { + id: string; + + // This Framework is a refinement of the parent framework. It can only be + // selected when the parent's requirements are also met. If this framework + // matches, its scripts take precedence over the parent's scripts. + requireFramework?: string; + + // Only analyze Frameworks with a runtime that matches the matched runtime + runtime: string; + + // e.g. nextjs. Used to verify that Web Frameworks' legacy code and the + // FrameworkSpec agree with one another + webFrameworkId?: string; + + // VSCode plugins that assist with writing a particular framework + suggestedPlugins?: string[]; + + requiredDependencies: Array<{ name: string; - description: string; - icon: string; - - // oneof - install: SampleInstallStrategy; - - // e.g. "javascript" and "typescript" variants - installVariants: Record; - } \ No newline at end of file + semver?: string; + }>; + + // If a requiredFiles is an array, then one of the files in the array must match. + // This supports, for example, a file that can be a js, ts, or mjs file. + requiredFiles?: Array; + + // Any commands that this framework needs that are not standard for the + // runtime. Often times, this can be empty (e.g. depend on npm run build and + // npm run start) + commands?: LifecycleCommands; + + // We must resolve to a single framework when getting build/dev/run commands. + // embedsFrameworks helps decide tiebreakers by saying, for example, that "astro" + // can embed "svelte", so if both frameworks are discovered, monospace can + // suggest both frameworks' plugins, but should run astro's commands. + embedsFrameworks?: string[]; + + samples?: FrameworkSample[]; +} + +export interface RuntimeSpec { + // e.g. `nodejs` + id: string; + + // e.g. `node18-slim`. Depends on user code (e.g. engine field in package.json) + baseImage: string; + + // e.g. `npm install yarn typescript` + packageManagerInstallCommand?: string; + + // e.g. `npm ci`, `npm install`, `yarn` + installCommand?: string; + + // Commands to run right before exporting the container image + // e.g. npm prune --omit=dev, yarn install --production=true + exportCommands?: string[]; + + // The runtime has detected a command that should always be run irrespective of + // the framework (e.g. the "build" script always wins in Node) + detectedCommands?: LifecycleCommands; + + fallbackCommands?: LifecycleCommands; +} + +export interface SampleInstallStrategy { + githubUrl: string; + command: string; +} + +export interface FrameworkSample { + name: string; + description: string; + icon: string; + + // oneof + install: SampleInstallStrategy; + + // e.g. "javascript" and "typescript" variants + installVariants: Record; +} From 5324af0c456dfcffa6900b04b3edd753f3fe0fd1 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:27:09 -0700 Subject: [PATCH 033/104] Discovery: Added code analyse codebase and match to a frameworkSpec --- .../compose/discover/frameworkMatcher.ts | 86 ++++++++++ .../compose/discover/frameworkMatcher.spec.ts | 156 ++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 src/frameworks/compose/discover/frameworkMatcher.ts create mode 100644 src/test/frameworks/compose/discover/frameworkMatcher.spec.ts diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts new file mode 100644 index 00000000000..48b29d23a0f --- /dev/null +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -0,0 +1,86 @@ +import { FrameworkSpec, FileSystem } from "./types"; + +/** + * + */ +export function filterFrameworksWithDependencies( + allFrameworkSpecs: FrameworkSpec[], + dependencies: Record +): FrameworkSpec[] { + return allFrameworkSpecs.filter((framework) => { + return framework.requiredDependencies.every((dependency) => + dependencies.hasOwnProperty(dependency["name"]) + ); + }); +} + +/** + * + */ +export function filterFrameworksWithFiles( + allFrameworkSpecs: FrameworkSpec[], + fs: FileSystem +): FrameworkSpec[] { + return allFrameworkSpecs.filter((framework) => { + if (!framework.requiredFiles) { + return true; + } + framework.requiredFiles.every((files) => { + if (Array.isArray(files)) { + return files.every((file) => fs.exists(file)); + } else { + return fs.exists(files); + } + }); + }); +} + +/** + * + */ +export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { + const embededFrameworkSet: Set = new Set(); + allFrameworkSpecs.forEach((framework) => { + if (!framework.embedsFrameworks) { + return; + } + framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); + }); + return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); +} + +/** + * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. + */ +export function frameworkMatcher( + runtime: string, + fs: FileSystem, + frameworks: FrameworkSpec[], + dependencies: Record +): FrameworkSpec | null { + try { + // Filter based on runtime name. + const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); + // Filter based on dependencies. + const frameworksWithDependencies = filterFrameworksWithDependencies( + filterRuntimeFramework, + dependencies + ); + // Filter based on files required. + const frameworkWithFiles = filterFrameworksWithFiles(frameworksWithDependencies, fs); + // Filter based on embeded Frameworks. + const allMatches = removeEmbededFrameworks(frameworkWithFiles); + + if (!allMatches.length) { + return null; + } + if (allMatches.length > 1) { + const frameworkNames = allMatches.map((framework) => framework.id); + throw new Error(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + } + + return allMatches[0]; + } catch (error: any) { + throw new Error("Failed to match the correct frameworkSpec", error.message); + } +} diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts new file mode 100644 index 00000000000..99992612666 --- /dev/null +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -0,0 +1,156 @@ +import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { expect } from "chai"; +import { + frameworkMatcher, + removeEmbededFrameworks, + filterFrameworksWithFiles, + filterFrameworksWithDependencies, +} from "../../../../frameworks/compose/discover/frameworkMatcher"; +import { frameworkSpecs } from "../../../../frameworks/compose/discover/frameworkSpec"; +import { FrameworkSpec } from "../../../../frameworks/compose/discover/types"; + +describe("frameworkMatcher", () => { + let fileSystem: RepositoryFileSystem; + const NODE_ID = "nodejs"; + + before(() => { + fileSystem = new RepositoryFileSystem("./testapps/express"); + }); + + describe("frameworkMatcher", () => { + it("should return express FrameworkSpec after analysing express application", () => { + const expressDependency: Record = { + express: "^4.18.2", + }; + const matchedFramework = frameworkMatcher( + NODE_ID, + fileSystem, + frameworkSpecs, + expressDependency + ); + const expressFrameworkSpec: FrameworkSpec = { + id: "express", + runtime: "nodejs", + webFrameworkId: "Express.js", + requiredDependencies: [ + { + name: "express", + }, + ], + }; + + expect(matchedFramework).to.equal(expressFrameworkSpec); + }); + }); + + describe("removeEmbededFrameworks", () => { + it("should return frameworks after removing embeded frameworks", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + embedsFrameworks: ["react"], + }, + { + id: "react", + runtime: "nodejs", + requiredDependencies: [], + }, + ]; + const actual = removeEmbededFrameworks(allFrameworks); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + embedsFrameworks: ["react"], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); + + describe("filterFrameworksWithFiles", () => { + it("should return frameworks having all the required files", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["package.json", "package-lock.json"], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["next.config.js", "next.config.ts"], + }, + ]; + const actual = filterFrameworksWithFiles(allFrameworks, fileSystem); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [], + requiredFiles: ["package.json", "package-lock.json"], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); + + describe("filterFrameworksWithDependencies", () => { + it("should return frameworks having required dependencies with in the project dependencies", () => { + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [ + { + name: "next", + }, + ], + }, + ]; + const projectDependencies: Record = { + express: "^4.18.2", + }; + const actual = filterFrameworksWithDependencies(allFrameworks, projectDependencies); + const expected: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [ + { + name: "express", + }, + ], + }, + ]; + + expect(actual).to.have.deep.members(expected); + }); + }); +}); From eff7156aa8918358fa695b1452e33072e294ad27 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:33:26 -0700 Subject: [PATCH 034/104] Added test express app --- .../testapps/expressApp/package-lock.json | 604 ++++++++++++++++++ .../discover/testapps/expressApp/package.json | 15 + 2 files changed, 619 insertions(+) create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json new file mode 100644 index 00000000000..36787cbc8cc --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json @@ -0,0 +1,604 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "expressapp", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json new file mode 100644 index 00000000000..4ffc74a94ff --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package.json @@ -0,0 +1,15 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } +} From 5154acc4cbe52b3c858e757cda02a927a2f26fc9 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:37:20 -0700 Subject: [PATCH 035/104] FileSystem now tests file existance and reads contents from test app --- src/frameworks/compose/discover/filesystem.ts | 18 +++++++-------- .../compose/discover/filesystem.spec.ts | 22 +++++++++++++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 298ab8279d4..51e1525958a 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,7 +1,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; -import { join } from "path"; import { logger } from "../../.."; +import * as path from "path"; /** * Find files or read contents present in the Repository. @@ -16,7 +16,7 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { if (!(file in this.contentCache)) { - this.existsCache[file] = await pathExists(join(this.cwd, file)); + this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } return this.existsCache[file]; @@ -26,20 +26,20 @@ export class RepositoryFileSystem implements FileSystem { } } - async read(path: string): Promise { - if (this.readErrorCache[path]) { - throw this.readErrorCache[path]; + async read(file: string): Promise { + if (this.readErrorCache[file]) { + throw this.readErrorCache[file]; } - if (!(path in this.contentCache)) { + if (!(file in this.contentCache)) { try { - const fileContents = await readFile(join(this.cwd, path), "utf-8"); - this.contentCache[path] = fileContents; + const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); + this.contentCache[file] = fileContents; } catch (error: any) { logger.error("Error occured while reading file contents:", error.message); throw error; } } - return this.contentCache[path]; + return this.contentCache[file]; } } diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index 639ea437652..c177451fab7 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -5,9 +5,7 @@ describe("RepositoryFileSystem", () => { let fileSystem: RepositoryFileSystem; before(() => { - fileSystem = new RepositoryFileSystem( - "/Users/svnsairam/Documents/google3/firebase-tools/src/frameworks/compose/discover/nodetestapp/nodeapp" - ); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/express"); }); describe("exists", () => { @@ -28,7 +26,23 @@ describe("RepositoryFileSystem", () => { it("should read and return the contents of the file", async () => { const fileContent = await fileSystem.read("package.json"); - expect(fileContent).to.equal(fileContent); + const expected = { + name: "express", + version: "1.0.0", + description: "", + main: "index.js", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + keywords: [], + author: "", + license: "ISC", + dependencies: { + express: "^4.18.2", + }, + }; + + expect(JSON.parse(fileContent)).to.deep.equal(expected); }); }); }); From c939217c27ca3b673f161e4e5a4ed5f8815adc8b Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:55:48 -0700 Subject: [PATCH 036/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 51e1525958a..bafe7fbc1a5 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,6 +15,9 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { + console.log("+++++++PPPPP+++++++++"); + console.log(path.resolve(this.cwd, file)); + console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From 7ee698bbb544f8c1a799d937511840ecd865d322 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:08:58 -0700 Subject: [PATCH 037/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index c177451fab7..cb4bc6c27a9 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -5,7 +5,7 @@ describe("RepositoryFileSystem", () => { let fileSystem: RepositoryFileSystem; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/express"); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); }); describe("exists", () => { From 180691569b53b751ba39c73f0157381649d62a56 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:09:25 -0700 Subject: [PATCH 038/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index bafe7fbc1a5..51e1525958a 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,9 +15,6 @@ export class RepositoryFileSystem implements FileSystem { async exists(file: string): Promise { try { - console.log("+++++++PPPPP+++++++++"); - console.log(path.resolve(this.cwd, file)); - console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From f470107f9c86c0c3075f4a23afdb32d632413f85 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:30:50 -0700 Subject: [PATCH 039/104] Changes to filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 51e1525958a..010918a2b12 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -4,7 +4,7 @@ import { logger } from "../../.."; import * as path from "path"; /** - * Find files or read contents present in the Repository. + * Find files or read contents present in the Repository */ export class RepositoryFileSystem implements FileSystem { private readonly existsCache: Record = {}; From ea339cdbe09968546f9ece2b82c50e276822465a Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:38:01 -0700 Subject: [PATCH 040/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index cb4bc6c27a9..f3185d7b88c 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -27,7 +27,7 @@ describe("RepositoryFileSystem", () => { const fileContent = await fileSystem.read("package.json"); const expected = { - name: "express", + name: "expressApp", version: "1.0.0", description: "", main: "index.js", From b5053e38e26b5b096dceef32d6ca9d14ca5dbddf Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:44:55 -0700 Subject: [PATCH 041/104] Update filesystem.spec.ts --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index f3185d7b88c..610b19c435b 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -27,7 +27,7 @@ describe("RepositoryFileSystem", () => { const fileContent = await fileSystem.read("package.json"); const expected = { - name: "expressApp", + name: "expressapp", version: "1.0.0", description: "", main: "index.js", From 2b6d37359e67103e28cba8baa11fe6c24220e002 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:01:17 -0700 Subject: [PATCH 042/104] Updated file system current working directory --- src/test/frameworks/compose/discover/frameworkMatcher.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index 99992612666..a91ff3c2dd2 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -14,7 +14,7 @@ describe("frameworkMatcher", () => { const NODE_ID = "nodejs"; before(() => { - fileSystem = new RepositoryFileSystem("./testapps/express"); + fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); }); describe("frameworkMatcher", () => { From cd5bbb8089c4883ec61e12d9e43006c7dc7c475f Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:03:50 -0700 Subject: [PATCH 043/104] Changes to filesystem.spec.ts --- output.txt | 4156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4156 insertions(+) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 00000000000..11295634134 --- /dev/null +++ b/output.txt @@ -0,0 +1,4156 @@ + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (251ms) + ✔ should throw when rewrite points to function being deleted (87ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8552ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (74ms) + #url + ✔ should craft URL from host and port in registry (74ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (151ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (73ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + 2) should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 4) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (246ms) + ✔ should throw when executable not found (249ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (107ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (23s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) RepositoryFileSystem + read + should read and return the contents of the file: + + AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } + + expected - actual + + "description": "" + "keywords": [] + "license": "ISC" + "main": "index.js" + - "name": "expressapp" + + "name": "expressApp" + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } + "version": "1.0.0" + + at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 4) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.51 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From a7b7b32d9ea56d32cbb76578cf36b21cc632512f Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 11:01:51 -0700 Subject: [PATCH 044/104] Added code to test if correct frameworkSpec is recognized --- output.txt | 74571 ++++++++++++++++ .../compose/discover/frameworkMatcher.ts | 47 +- .../compose/discover/frameworkMatcher.spec.ts | 16 +- 3 files changed, 74607 insertions(+), 27 deletions(-) diff --git a/output.txt b/output.txt index 11295634134..29199f81741 100644 --- a/output.txt +++ b/output.txt @@ -4154,3 +4154,74574 @@ All files | 55.8 | 43.51 | 51.57 | 55.91 task-error.ts | 100 | 100 | 100 | 100 | timeout-error.ts | 100 | 100 | 100 | 100 | ---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (286ms) + ✔ should throw when rewrite points to function being deleted (123ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (84ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9113ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (115ms) + ✔ once stopped, an emulator is no longer running (476ms) + #url + ✔ should craft URL from host and port in registry (175ms) + ✔ should quote IPv6 addresses (134ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) + ✔ should use ::1 instead of :: (147ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (75ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 3) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (253ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (256ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (25s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 3) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.52 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (98ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9259ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (95ms) + ✔ once stopped, an emulator is no longer running (76ms) + #url + ✔ should craft URL from host and port in registry (79ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (154ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (267ms) + ✔ should throw when npm root not found (261ms) + ✔ should throw when executable not found (276ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (120ms) + ✔ creates a new typescript codebase with the correct configuration (117ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.53 | 51.53 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (102ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9239ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (107ms) + ✔ once stopped, an emulator is no longer running (83ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (164ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++PPPPPP+++++++++++ +[ true, true ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++PPPPPP+++++++++++ +[ false ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (259ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (265ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (220ms) + ✔ should throw when rewrite points to function being deleted (130ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9155ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (132ms) + ✔ once stopped, an emulator is no longer running (181ms) + #url + 2) should craft URL from host and port in registry + 3) should quote IPv6 addresses + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (148ms) + ✔ should use protocol from request if available (80ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++PPPP+++++++++ + 4) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [], + requiredFiles: [ [Array] ] + } +] +++++++++PPPP+++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (250ms) + ✔ should throw when executable not found (247ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (114ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (27s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should craft URL from host and port in registry: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) EmulatorRegistry + #url + should quote IPv6 addresses: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 4) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.54 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (362ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + 2) updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (88ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8595ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (158ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (254ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (252ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (124ms) + ✔ creates a new typescript codebase with the correct configuration (119ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (105ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (23s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: tenant management + updateTenants + updates tenant config: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.52 | 51.61 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (134ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (82ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9209ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (579ms) + ✔ once stopped, an emulator is no longer running (592ms) + #url + ✔ should craft URL from host and port in registry (458ms) + ✔ should quote IPv6 addresses (169ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) + ✔ should use ::1 instead of :: (741ms) + ✔ should use protocol from request if available (371ms) + ✔ should use host from request if available (101ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (257ms) + ✔ should throw when npm root not found (253ms) + ✔ should throw when executable not found (257ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (113ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (168ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (75ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8982ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (685ms) + ✔ once stopped, an emulator is no longer running (329ms) + #url + ✔ should craft URL from host and port in registry (89ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (152ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (124ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (248ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (223ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (87ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8904ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (101ms) + ✔ once stopped, an emulator is no longer running (82ms) + #url + ✔ should craft URL from host and port in registry (83ms) + ✔ should quote IPv6 addresses (85ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (258ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (127ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (77ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (112ms) + ✔ should throw when rewrite points to function being deleted (64ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8833ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (97ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (78ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (664ms) + ✔ should throw when npm root not found (321ms) + ✔ should throw when executable not found (336ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (49ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (256ms) + ✔ should throw when rewrite points to function being deleted (76ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8626ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (91ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (121ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (260ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (253ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (116ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (149ms) + ✔ should throw when rewrite points to function being deleted (63ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (90ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8882ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (86ms) + ✔ should quote IPv6 addresses (84ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (168ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (263ms) + ✔ should throw when npm root not found (255ms) + ✔ should throw when executable not found (263ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (122ms) + ✔ creates a new typescript codebase with the correct configuration (114ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (80ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled (38ms) + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (115ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9556ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (102ms) + ✔ once stopped, an emulator is no longer running (90ms) + #url + ✔ should craft URL from host and port in registry (84ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (165ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (81ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (517ms) + ✔ should throw when npm root not found (796ms) + ✔ should throw when executable not found (1834ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (121ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.85 | 43.53 | 51.61 | 55.96 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (129ms) + ✔ should throw when rewrite points to function being deleted (54ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + 2) should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (101ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10908ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (109ms) + ✔ once stopped, an emulator is no longer running (93ms) + #url + ✔ should craft URL from host and port in registry (92ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) + ✔ should use ::1 instead of :: (169ms) + ✔ should use protocol from request if available (85ms) + ✔ should use host from request if available (87ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (291ms) + ✔ should throw when npm root not found (364ms) + ✔ should throw when executable not found (769ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (131ms) + ✔ creates a new typescript codebase with the correct configuration (121ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (29s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: accounts:createAuthUri + should find user by either IDP email or 'top-level' email: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response (78ms) + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (302ms) + ✔ should throw when rewrite points to function being deleted (40ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (89ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10281ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (91ms) + ✔ once stopped, an emulator is no longer running (92ms) + #url + ✔ should craft URL from host and port in registry (91ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) + ✔ should use ::1 instead of :: (170ms) + ✔ should use protocol from request if available (92ms) + ✔ should use host from request if available (113ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (288ms) + ✔ should throw when npm root not found (280ms) + ✔ should throw when executable not found (288ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (142ms) + ✔ creates a new typescript codebase with the correct configuration (146ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (100ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (27s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8615ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (256ms) + ✔ once stopped, an emulator is no longer running (957ms) + #url + ✔ should craft URL from host and port in registry (893ms) + ✔ should quote IPv6 addresses (432ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (249ms) + ✔ should use protocol from request if available (102ms) + 2) should use host from request if available + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (139ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (255ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (105ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (26s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should use host from request if available: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (113ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8835ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (94ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (77ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (159ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (265ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (272ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (96ms) + ✔ should throw when rewrite points to function being deleted (59ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled (47ms) + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8923ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (80ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) + ✔ should use ::1 instead of :: (157ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] ++++++++EXPECT+++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} ++++++++ACTUAL+++++++ +Promise { } ++++++END+++++++ + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (260ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (104ms) + ✔ should throw when rewrite points to function being deleted (52ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (74ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8598ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (92ms) + ✔ once stopped, an emulator is no longer running (78ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + ✔ should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (258ms) + ✔ should throw when executable not found (250ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (113ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2542 passing (22s) + 4 pending + 1 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index 48b29d23a0f..3cb0ee0e17e 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -8,31 +8,40 @@ export function filterFrameworksWithDependencies( dependencies: Record ): FrameworkSpec[] { return allFrameworkSpecs.filter((framework) => { - return framework.requiredDependencies.every((dependency) => - dependencies.hasOwnProperty(dependency["name"]) - ); + return framework.requiredDependencies.every((dep) => { + return dep["name"] in dependencies; + }); }); } /** * */ -export function filterFrameworksWithFiles( +export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem -): FrameworkSpec[] { - return allFrameworkSpecs.filter((framework) => { +): Promise { + const filteredFrameworks = []; + for (const framework of allFrameworkSpecs) { if (!framework.requiredFiles) { - return true; + filteredFrameworks.push(framework); + continue; } - framework.requiredFiles.every((files) => { - if (Array.isArray(files)) { - return files.every((file) => fs.exists(file)); - } else { - return fs.exists(files); - } - }); - }); + const isRequired = await Promise.all( + framework.requiredFiles.map(async (files) => { + if (Array.isArray(files)) { + const boolArray = await Promise.all(files.map((file) => fs.exists(file))); + return boolArray.every((x) => x); + } else { + return await fs.exists(files); + } + }) + ); + if (isRequired.every((x) => x)) { + filteredFrameworks.push(framework); + } + } + return filteredFrameworks; } /** @@ -52,12 +61,12 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra /** * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. */ -export function frameworkMatcher( +export async function frameworkMatcher( runtime: string, fs: FileSystem, frameworks: FrameworkSpec[], dependencies: Record -): FrameworkSpec | null { +): Promise { try { // Filter based on runtime name. const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); @@ -67,11 +76,11 @@ export function frameworkMatcher( dependencies ); // Filter based on files required. - const frameworkWithFiles = filterFrameworksWithFiles(frameworksWithDependencies, fs); + const frameworkWithFiles = await filterFrameworksWithFiles(frameworksWithDependencies, fs); // Filter based on embeded Frameworks. const allMatches = removeEmbededFrameworks(frameworkWithFiles); - if (!allMatches.length) { + if (allMatches.length === 0) { return null; } if (allMatches.length > 1) { diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index a91ff3c2dd2..50c10ba7bb2 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -18,11 +18,11 @@ describe("frameworkMatcher", () => { }); describe("frameworkMatcher", () => { - it("should return express FrameworkSpec after analysing express application", () => { + it("should return express FrameworkSpec after analysing express application", async () => { const expressDependency: Record = { express: "^4.18.2", }; - const matchedFramework = frameworkMatcher( + const matchedFramework = await frameworkMatcher( NODE_ID, fileSystem, frameworkSpecs, @@ -39,7 +39,7 @@ describe("frameworkMatcher", () => { ], }; - expect(matchedFramework).to.equal(expressFrameworkSpec); + expect(matchedFramework).to.deep.equal(expressFrameworkSpec); }); }); @@ -83,28 +83,28 @@ describe("frameworkMatcher", () => { }); describe("filterFrameworksWithFiles", () => { - it("should return frameworks having all the required files", () => { + it("should return frameworks having all the required files", async () => { const allFrameworks: FrameworkSpec[] = [ { id: "express", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["package.json", "package-lock.json"], + requiredFiles: [["package.json", "package-lock.json"]], }, { id: "next", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["next.config.js", "next.config.ts"], + requiredFiles: [["next.config.js"], "next.config.ts"], }, ]; - const actual = filterFrameworksWithFiles(allFrameworks, fileSystem); + const actual = await filterFrameworksWithFiles(allFrameworks, fileSystem); const expected: FrameworkSpec[] = [ { id: "express", runtime: "nodejs", requiredDependencies: [], - requiredFiles: ["package.json", "package-lock.json"], + requiredFiles: [["package.json", "package-lock.json"]], }, ]; From 9252f3d7ab6c524fa5b8b87436a5777dce8efd05 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:00:31 -0700 Subject: [PATCH 045/104] Created node runtime to analyse framework --- output.txt | 78727 ---------------- .../compose/discover/runtime/node.ts | 0 .../compose/discover/runtime/node.spec.ts | 0 3 files changed, 78727 deletions(-) delete mode 100644 output.txt create mode 100644 src/frameworks/compose/discover/runtime/node.ts create mode 100644 src/test/frameworks/compose/discover/runtime/node.spec.ts diff --git a/output.txt b/output.txt deleted file mode 100644 index 29199f81741..00000000000 --- a/output.txt +++ /dev/null @@ -1,78727 +0,0 @@ - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (251ms) - ✔ should throw when rewrite points to function being deleted (87ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8552ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (74ms) - #url - ✔ should craft URL from host and port in registry (74ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (151ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (73ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - 2) should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 4) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (246ms) - ✔ should throw when executable not found (249ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (107ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (23s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) RepositoryFileSystem - read - should read and return the contents of the file: - - AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } - + expected - actual - - "description": "" - "keywords": [] - "license": "ISC" - "main": "index.js" - - "name": "expressapp" - + "name": "expressApp" - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - } - "version": "1.0.0" - - at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 4) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.51 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (286ms) - ✔ should throw when rewrite points to function being deleted (123ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (84ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9113ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (115ms) - ✔ once stopped, an emulator is no longer running (476ms) - #url - ✔ should craft URL from host and port in registry (175ms) - ✔ should quote IPv6 addresses (134ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) - ✔ should use ::1 instead of :: (147ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (75ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 3) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (253ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (256ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (25s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 3) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.52 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (98ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9259ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (95ms) - ✔ once stopped, an emulator is no longer running (76ms) - #url - ✔ should craft URL from host and port in registry (79ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (154ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (267ms) - ✔ should throw when npm root not found (261ms) - ✔ should throw when executable not found (276ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (120ms) - ✔ creates a new typescript codebase with the correct configuration (117ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.53 | 51.53 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (102ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9239ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (107ms) - ✔ once stopped, an emulator is no longer running (83ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (164ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++PPPPPP+++++++++++ -[ true, true ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++PPPPPP+++++++++++ -[ false ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (259ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (265ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (220ms) - ✔ should throw when rewrite points to function being deleted (130ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9155ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (132ms) - ✔ once stopped, an emulator is no longer running (181ms) - #url - 2) should craft URL from host and port in registry - 3) should quote IPv6 addresses - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (148ms) - ✔ should use protocol from request if available (80ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++PPPP+++++++++ - 4) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [], - requiredFiles: [ [Array] ] - } -] -++++++++PPPP+++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (250ms) - ✔ should throw when executable not found (247ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (114ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (27s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should craft URL from host and port in registry: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) EmulatorRegistry - #url - should quote IPv6 addresses: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 4) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.54 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (362ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - 2) updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (88ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8595ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (158ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (254ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (252ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (124ms) - ✔ creates a new typescript codebase with the correct configuration (119ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (105ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (23s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: tenant management - updateTenants - updates tenant config: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.52 | 51.61 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (134ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (82ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9209ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (579ms) - ✔ once stopped, an emulator is no longer running (592ms) - #url - ✔ should craft URL from host and port in registry (458ms) - ✔ should quote IPv6 addresses (169ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) - ✔ should use ::1 instead of :: (741ms) - ✔ should use protocol from request if available (371ms) - ✔ should use host from request if available (101ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (257ms) - ✔ should throw when npm root not found (253ms) - ✔ should throw when executable not found (257ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (113ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (168ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (75ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8982ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (685ms) - ✔ once stopped, an emulator is no longer running (329ms) - #url - ✔ should craft URL from host and port in registry (89ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (152ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (124ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (248ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (223ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (87ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8904ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (101ms) - ✔ once stopped, an emulator is no longer running (82ms) - #url - ✔ should craft URL from host and port in registry (83ms) - ✔ should quote IPv6 addresses (85ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (258ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (127ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (77ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (112ms) - ✔ should throw when rewrite points to function being deleted (64ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8833ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (97ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (78ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (664ms) - ✔ should throw when npm root not found (321ms) - ✔ should throw when executable not found (336ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (49ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (256ms) - ✔ should throw when rewrite points to function being deleted (76ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8626ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (91ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (121ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (260ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (253ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (116ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (149ms) - ✔ should throw when rewrite points to function being deleted (63ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (90ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8882ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (86ms) - ✔ should quote IPv6 addresses (84ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (168ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (263ms) - ✔ should throw when npm root not found (255ms) - ✔ should throw when executable not found (263ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (122ms) - ✔ creates a new typescript codebase with the correct configuration (114ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (80ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled (38ms) - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (115ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9556ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (102ms) - ✔ once stopped, an emulator is no longer running (90ms) - #url - ✔ should craft URL from host and port in registry (84ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (165ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (81ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (517ms) - ✔ should throw when npm root not found (796ms) - ✔ should throw when executable not found (1834ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (121ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.85 | 43.53 | 51.61 | 55.96 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (129ms) - ✔ should throw when rewrite points to function being deleted (54ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - 2) should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (101ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10908ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (109ms) - ✔ once stopped, an emulator is no longer running (93ms) - #url - ✔ should craft URL from host and port in registry (92ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) - ✔ should use ::1 instead of :: (169ms) - ✔ should use protocol from request if available (85ms) - ✔ should use host from request if available (87ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (291ms) - ✔ should throw when npm root not found (364ms) - ✔ should throw when executable not found (769ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (131ms) - ✔ creates a new typescript codebase with the correct configuration (121ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (29s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: accounts:createAuthUri - should find user by either IDP email or 'top-level' email: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response (78ms) - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (302ms) - ✔ should throw when rewrite points to function being deleted (40ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (89ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10281ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (91ms) - ✔ once stopped, an emulator is no longer running (92ms) - #url - ✔ should craft URL from host and port in registry (91ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) - ✔ should use ::1 instead of :: (170ms) - ✔ should use protocol from request if available (92ms) - ✔ should use host from request if available (113ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (288ms) - ✔ should throw when npm root not found (280ms) - ✔ should throw when executable not found (288ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (142ms) - ✔ creates a new typescript codebase with the correct configuration (146ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (100ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (27s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8615ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (256ms) - ✔ once stopped, an emulator is no longer running (957ms) - #url - ✔ should craft URL from host and port in registry (893ms) - ✔ should quote IPv6 addresses (432ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (249ms) - ✔ should use protocol from request if available (102ms) - 2) should use host from request if available - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (139ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (255ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (105ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (26s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should use host from request if available: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (113ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8835ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (94ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (77ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (159ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (265ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (272ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (96ms) - ✔ should throw when rewrite points to function being deleted (59ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled (47ms) - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8923ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (80ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) - ✔ should use ::1 instead of :: (157ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -+++++++EXPECT+++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} -+++++++ACTUAL+++++++ -Promise { } -+++++END+++++++ - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (260ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (104ms) - ✔ should throw when rewrite points to function being deleted (52ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (74ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8598ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (92ms) - ✔ once stopped, an emulator is no longer running (78ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - ✔ should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (258ms) - ✔ should throw when executable not found (250ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (113ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2542 passing (22s) - 4 pending - 1 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts new file mode 100644 index 00000000000..e69de29bb2d From fcf2bdbef4eae1b3957adbd6d5d7cbcff17cae53 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:30:49 -0700 Subject: [PATCH 046/104] Modified next commands --- src/frameworks/compose/discover/frameworkSpec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkSpec.ts b/src/frameworks/compose/discover/frameworkSpec.ts index 9b1422f5e7c..70655a85b07 100644 --- a/src/frameworks/compose/discover/frameworkSpec.ts +++ b/src/frameworks/compose/discover/frameworkSpec.ts @@ -23,14 +23,14 @@ export const frameworkSpecs: FrameworkSpec[] = [ ], commands: { build: { - cmd: "npx next build", + cmd: "next build", }, dev: { - cmd: "npx next dev", + cmd: "next dev", env: { NODE_ENV: "dev" }, }, run: { - cmd: "npx next run", + cmd: "next run", env: { NODE_ENV: "production" }, }, }, From 608cc649b7454fd1e62becef75ef7b5230713531 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:36:58 -0700 Subject: [PATCH 047/104] Removed types which aren't focused at this time. --- src/frameworks/compose/discover/types.ts | 34 +++--------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts index b2e52414ce1..97fff3ea56c 100644 --- a/src/frameworks/compose/discover/types.ts +++ b/src/frameworks/compose/discover/types.ts @@ -13,7 +13,8 @@ export interface Command { // Consider: string[] for series of commands that must execute successfully // in sequence. cmd: string | string[]; - script?: string; + + // Environment in which command is executed. env?: Record; } @@ -26,11 +27,6 @@ export interface LifecycleCommands { export interface FrameworkSpec { id: string; - // This Framework is a refinement of the parent framework. It can only be - // selected when the parent's requirements are also met. If this framework - // matches, its scripts take precedence over the parent's scripts. - requireFramework?: string; - // Only analyze Frameworks with a runtime that matches the matched runtime runtime: string; @@ -38,11 +34,10 @@ export interface FrameworkSpec { // FrameworkSpec agree with one another webFrameworkId?: string; - // VSCode plugins that assist with writing a particular framework - suggestedPlugins?: string[]; - + // List of dependencies that should be present in the project. requiredDependencies: Array<{ name: string; + // Version semver?: string; }>; @@ -60,8 +55,6 @@ export interface FrameworkSpec { // can embed "svelte", so if both frameworks are discovered, monospace can // suggest both frameworks' plugins, but should run astro's commands. embedsFrameworks?: string[]; - - samples?: FrameworkSample[]; } export interface RuntimeSpec { @@ -84,23 +77,4 @@ export interface RuntimeSpec { // The runtime has detected a command that should always be run irrespective of // the framework (e.g. the "build" script always wins in Node) detectedCommands?: LifecycleCommands; - - fallbackCommands?: LifecycleCommands; -} - -export interface SampleInstallStrategy { - githubUrl: string; - command: string; -} - -export interface FrameworkSample { - name: string; - description: string; - icon: string; - - // oneof - install: SampleInstallStrategy; - - // e.g. "javascript" and "typescript" variants - installVariants: Record; } From 0d3b2d28a948dac30a261f9623a520882de67644 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:02:15 -0700 Subject: [PATCH 048/104] Added mockFileSystem for testing --- src/frameworks/compose/discover/filesystem.ts | 19 +- .../testapps/expressApp/package-lock.json | 604 ------------------ .../discover/testapps/expressApp/package.json | 15 - .../compose/discover/filesystem.spec.ts | 28 +- .../compose/discover/mockFileSystem.ts | 16 + 5 files changed, 41 insertions(+), 641 deletions(-) delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json create mode 100644 src/test/frameworks/compose/discover/mockFileSystem.ts diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 010918a2b12..db614ef5794 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -1,12 +1,12 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; -import { logger } from "../../.."; import * as path from "path"; +import { FirebaseError } from "../../../error"; /** - * Find files or read contents present in the Repository + * Find files or read file contents present in the directory. */ -export class RepositoryFileSystem implements FileSystem { +export class LocalFileSystem implements FileSystem { private readonly existsCache: Record = {}; private readonly contentCache: Record = {}; private readonly readErrorCache: Record = {}; @@ -20,9 +20,8 @@ export class RepositoryFileSystem implements FileSystem { } return this.existsCache[file]; - } catch (error: any) { - logger.error("Error occured while searching for file:", error.message); - throw error; + } catch (error) { + throw new FirebaseError("Error occured while searching for file."); } } @@ -34,9 +33,8 @@ export class RepositoryFileSystem implements FileSystem { try { const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); this.contentCache[file] = fileContents; - } catch (error: any) { - logger.error("Error occured while reading file contents:", error.message); - throw error; + } catch (error) { + throw new FirebaseError("Error occured while reading file contents."); } } return this.contentCache[file]; @@ -53,7 +51,6 @@ export async function readOrNull(fs: FileSystem, path: string): Promise= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json deleted file mode 100644 index 4ffc74a94ff..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index 610b19c435b..fac0de589fb 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,11 +1,22 @@ -import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; describe("RepositoryFileSystem", () => { - let fileSystem: RepositoryFileSystem; + let fileSystem: MockFileSystem; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); + fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + name: "expressapp", + version: "1.0.0", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + dependencies: { + express: "^4.18.2", + }, + }), + }); }); describe("exists", () => { @@ -26,23 +37,18 @@ describe("RepositoryFileSystem", () => { it("should read and return the contents of the file", async () => { const fileContent = await fileSystem.read("package.json"); - const expected = { + const expected = JSON.stringify({ name: "expressapp", version: "1.0.0", - description: "", - main: "index.js", scripts: { test: 'echo "Error: no test specified" && exit 1', }, - keywords: [], - author: "", - license: "ISC", dependencies: { express: "^4.18.2", }, - }; + }); - expect(JSON.parse(fileContent)).to.deep.equal(expected); + expect(fileContent).to.equal(expected); }); }); }); diff --git a/src/test/frameworks/compose/discover/mockFileSystem.ts b/src/test/frameworks/compose/discover/mockFileSystem.ts new file mode 100644 index 00000000000..6f1a1f5f0a6 --- /dev/null +++ b/src/test/frameworks/compose/discover/mockFileSystem.ts @@ -0,0 +1,16 @@ +import { FileSystem } from "../../../../frameworks/compose/discover/types"; + +export class MockFileSystem implements FileSystem { + constructor(private readonly mock: Record) {} + + exists(path: string): Promise { + return Promise.resolve(path in this.mock); + } + + read(path: string): Promise { + if (!(path in this.mock)) { + throw new Error("File not found in the mock file system."); + } + return Promise.resolve(this.mock[path]); + } +} From aebaf5bb7305cf5ee2f6e06be6e3cf494ad42af6 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:43:46 -0700 Subject: [PATCH 049/104] Added error handling --- src/frameworks/compose/discover/filesystem.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index db614ef5794..2e0f6b257c1 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -2,6 +2,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import * as path from "path"; import { FirebaseError } from "../../../error"; +import { logger } from "../../.."; /** * Find files or read file contents present in the directory. @@ -9,7 +10,6 @@ import { FirebaseError } from "../../../error"; export class LocalFileSystem implements FileSystem { private readonly existsCache: Record = {}; private readonly contentCache: Record = {}; - private readonly readErrorCache: Record = {}; constructor(private readonly cwd: string) {} @@ -26,18 +26,16 @@ export class LocalFileSystem implements FileSystem { } async read(file: string): Promise { - if (this.readErrorCache[file]) { - throw this.readErrorCache[file]; - } - if (!(file in this.contentCache)) { - try { + try { + if (!(file in this.contentCache)) { const fileContents = await readFile(path.resolve(this.cwd, file), "utf-8"); this.contentCache[file] = fileContents; - } catch (error) { - throw new FirebaseError("Error occured while reading file contents."); } + return this.contentCache[file]; + } catch (error) { + logger.log("Error occured while reading file contents."); + throw error; } - return this.contentCache[file]; } } From 25fc256f8047d1c1fa1f14b88d822a32d1c233a3 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:38:28 -0700 Subject: [PATCH 050/104] Resolved code comments --- .../compose/discover/frameworkMatcher.ts | 95 ++++++++++--------- .../compose/discover/frameworkMatcher.spec.ts | 18 +++- 2 files changed, 65 insertions(+), 48 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index 3cb0ee0e17e..cc5c99af377 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -1,65 +1,74 @@ +import { logger } from "../../.."; +import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; -/** - * - */ export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], dependencies: Record ): FrameworkSpec[] { - return allFrameworkSpecs.filter((framework) => { - return framework.requiredDependencies.every((dep) => { - return dep["name"] in dependencies; + try { + return allFrameworkSpecs.filter((framework) => { + return framework.requiredDependencies.every((dependency) => { + return dependency.name in dependencies; + }); }); - }); + } catch (error: any) { + logger.log("Error while filtering FrameworksWithDependencies", error.message); + throw error; + } } -/** - * - */ export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem ): Promise { - const filteredFrameworks = []; - for (const framework of allFrameworkSpecs) { - if (!framework.requiredFiles) { - filteredFrameworks.push(framework); - continue; - } - const isRequired = await Promise.all( - framework.requiredFiles.map(async (files) => { + try { + const filteredFrameworks = []; + for (const framework of allFrameworkSpecs) { + if (!framework.requiredFiles) { + filteredFrameworks.push(framework); + continue; + } + let isRequired = true; + for (const files of framework.requiredFiles) { if (Array.isArray(files)) { - const boolArray = await Promise.all(files.map((file) => fs.exists(file))); - return boolArray.every((x) => x); + for (const file of files) { + isRequired = isRequired && (await fs.exists(file)); + } } else { - return await fs.exists(files); + isRequired = isRequired && (await fs.exists(files)); } - }) - ); - if (isRequired.every((x) => x)) { - filteredFrameworks.push(framework); + } + + if (isRequired) { + filteredFrameworks.push(framework); + } } + return filteredFrameworks; + } catch (error: any) { + logger.log("Error while filtering FrameworksWithFiles", error.message); + throw error; } - return filteredFrameworks; } -/** - * - */ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { - const embededFrameworkSet: Set = new Set(); - allFrameworkSpecs.forEach((framework) => { - if (!framework.embedsFrameworks) { - return; - } - framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); - }); - return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); + try { + const embededFrameworkSet: Set = new Set(); + allFrameworkSpecs.forEach((framework) => { + if (!framework.embedsFrameworks) { + return; + } + framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); + }); + return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); + } catch (error: any) { + logger.log("Error occured while removing Embeded Frameworks", error.message); + throw error; + } } /** - * Identifies the correct FrameworkSpec for the codebase. kjajfkjasd. + * Identifies the correct FrameworkSpec for the codebase. */ export async function frameworkMatcher( runtime: string, @@ -68,16 +77,12 @@ export async function frameworkMatcher( dependencies: Record ): Promise { try { - // Filter based on runtime name. const filterRuntimeFramework = frameworks.filter((framework) => framework.runtime === runtime); - // Filter based on dependencies. const frameworksWithDependencies = filterFrameworksWithDependencies( filterRuntimeFramework, dependencies ); - // Filter based on files required. const frameworkWithFiles = await filterFrameworksWithFiles(frameworksWithDependencies, fs); - // Filter based on embeded Frameworks. const allMatches = removeEmbededFrameworks(frameworkWithFiles); if (allMatches.length === 0) { @@ -85,11 +90,11 @@ export async function frameworkMatcher( } if (allMatches.length > 1) { const frameworkNames = allMatches.map((framework) => framework.id); - throw new Error(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + throw new FirebaseError(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); } return allMatches[0]; - } catch (error: any) { - throw new Error("Failed to match the correct frameworkSpec", error.message); + } catch (error) { + throw new FirebaseError("Failed to match the correct frameworkSpec"); } } diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index 50c10ba7bb2..60ce9c6997c 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -1,4 +1,4 @@ -import { RepositoryFileSystem } from "../../../../frameworks/compose/discover/filesystem"; +import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; import { frameworkMatcher, @@ -10,11 +10,23 @@ import { frameworkSpecs } from "../../../../frameworks/compose/discover/framewor import { FrameworkSpec } from "../../../../frameworks/compose/discover/types"; describe("frameworkMatcher", () => { - let fileSystem: RepositoryFileSystem; + let fileSystem: MockFileSystem; const NODE_ID = "nodejs"; before(() => { - fileSystem = new RepositoryFileSystem("./src/frameworks/compose/discover/testapps/expressApp"); + fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + name: "expressapp", + version: "1.0.0", + scripts: { + test: 'echo "Error: no test specified" && exit 1', + }, + dependencies: { + express: "^4.18.2", + }, + }), + "package-lock.json": "Unused: contents of package-lock file", + }); }); describe("frameworkMatcher", () => { From 196828b6b4443fa4f320763e1e547dd00841ac97 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:58:13 -0700 Subject: [PATCH 051/104] Removed lint errors --- .../compose/discover/frameworkMatcher.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index cc5c99af377..e8bb394fc11 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -1,6 +1,6 @@ -import { logger } from "../../.."; import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; +import { logger } from "../../../logger"; export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], @@ -12,8 +12,8 @@ export function filterFrameworksWithDependencies( return dependency.name in dependencies; }); }); - } catch (error: any) { - logger.log("Error while filtering FrameworksWithDependencies", error.message); + } catch (error) { + logger.error("Error while filtering FrameworksWithDependencies", error); throw error; } } @@ -45,8 +45,8 @@ export async function filterFrameworksWithFiles( } } return filteredFrameworks; - } catch (error: any) { - logger.log("Error while filtering FrameworksWithFiles", error.message); + } catch (error) { + logger.error("Error while filtering FrameworksWithFiles", error); throw error; } } @@ -61,8 +61,8 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); }); return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); - } catch (error: any) { - logger.log("Error occured while removing Embeded Frameworks", error.message); + } catch (error) { + logger.error("Error occured while removing Embeded Frameworks", error.message); throw error; } } From 5252b9ec7e5333760fa8842fca0b803b21ef2ff7 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 16:00:34 -0700 Subject: [PATCH 052/104] Removed lint errors --- src/frameworks/compose/discover/frameworkMatcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index e8bb394fc11..b8f6b63cd56 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -62,7 +62,7 @@ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): Fra }); return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); } catch (error) { - logger.error("Error occured while removing Embeded Frameworks", error.message); + logger.error("Error occured while removing Embeded Frameworks", error); throw error; } } From aac90038a2a16b42bd9f606ad8a7239980843e72 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 053/104] Added code for Node runtime --- .../compose/discover/runtime/node.ts | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index e69de29bb2d..44849ffddf2 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -0,0 +1,246 @@ +import { readOrNull } from "../filesystem"; +import { FileSystem, FrameworkSpec, Runtime } from "../types"; +import { RuntimeSpec } from "../types"; +import { frameworkMatcher } from "../frameworkMatcher"; +import { LifecycleCommands } from "../types"; +import { Command } from "../types"; +import { join } from "path"; +import { logger } from "../../../../logger"; +import { FirebaseError } from "../../../../error"; + +interface PackageJSON { + dependencies?: Record; + devDependencies?: Record; + scripts?: Record; + engines: Record; +} + +const NODE = "node"; +const NODE_LATEST_BASE_IMAGE = "node:18-slim"; +const NODE_RUNTIME_ID = "nodejs"; +const PACKAGE_JSON = "package.json"; +const PACKAGE_LOCK_JSON = "package-lock.json"; +const YARN = "yarn"; +const YARN_LOCK = "yarn.lock"; +const NPM = "npm"; + +export class NodejsRuntime implements Runtime { + private readonly runtimeName = NODE_RUNTIME_ID; + private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + + // Checks if the codebase is using Node as runtime. + async match(fs: FileSystem): Promise { + const areAllFilesPresent = await Promise.all( + this.runtimeRequiredFiles.map((file) => fs.exists(file)) + ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); + } + + getRuntimeName(): string { + return this.runtimeName; + } + + getNodeVersion(version: Record): string { + try { + // If no version is mentioned explicitly, assuming application is compatible with latest version. + if (!version) { + return NODE_LATEST_BASE_IMAGE; + } + const nodeVersion = version[NODE]; + // Splits version number `>=18..0.5` to `>=` and `18.0.5` + const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionMatch = versionPattern.exec(nodeVersion); + if (!versionMatch) { + return NODE_LATEST_BASE_IMAGE; + } + const operator = versionMatch[1]; + const versionNumber = versionMatch[2]; + const majorVersion = parseInt(versionNumber.split(".")[0]); + if (!operator && majorVersion < 18) { + throw new FirebaseError( + "Unsupported node version number, only versions >= 18 are supported." + ); + } + + return NODE_LATEST_BASE_IMAGE; + } catch (error) { + logger.error("Failed to getNodeVersion", error); + throw error; + } + } + + async getPackageManager(fs: FileSystem): Promise { + if (await fs.exists(YARN_LOCK)) { + return YARN; + } + return NPM; + } + + async getDependenciesForNPM( + fs: FileSystem, + packageJSON: PackageJSON + ): Promise> { + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); + if (!packageLockJSONRaw) { + return {}; + } + const packageLockJSON = JSON.parse(packageLockJSONRaw); + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + const directDependenciesKeys = Object.keys(directDependencies).map((x) => + join("node_modules", x) + ); + let transitiveDependencies = {}; + directDependenciesKeys.forEach((key) => { + const deps = packageLockJSON.packages[key]["dependencies"]; + transitiveDependencies = { ...transitiveDependencies, ...deps }; + }); + return { ...directDependencies, ...transitiveDependencies }; + } + + async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + try { + let dependencies = {}; + if (packageManager === NPM) { + dependencies = await this.getDependenciesForNPM(fs, packageJSON); + } + return dependencies; + } catch (error: any) { + throw new Error("Failed to getDependencies for the project", error.message); + } + } + + packageManagerInstallCommand(packageManager: string): string | undefined { + const packages: string[] = []; + if (packageManager === "yarn") { + packages.push("yarn"); + } + if (!packages.length) { + return undefined; + } + + return `npm install --global ${packages.join(" ")}`; + } + + installCommand(packageManager: string): string | undefined { + if (packageManager === "npm") { + return "npm ci"; + } else if (packageManager === "yarn") { + return "yarn install"; + } + + return undefined; + } + + detectedCommands( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): LifecycleCommands { + const commands: LifecycleCommands = { + build: this.getBuildCommand(packageManager, scripts, matchedFramework), + dev: this.getDevCommand(packageManager, scripts, matchedFramework), + run: this.getRunCommand(packageManager, scripts, matchedFramework), + }; + + return commands; + } + + // Converts the prefix of command to required packageManager. + // Ex: If packageManager is 'yarn' then converts `npm run build` to `yarn run build`. + replaceCommandPrefixWithPackageManager(command: Command, packageManager: string): Command { + if (command.cmd !== "") { + if (Array.isArray(command.cmd)) { + command.cmd.map((currCmd) => currCmd.replace(/^\S+/, packageManager)); + } else { + command.cmd.replace(/^\S+/, packageManager); + } + } + return command; + } + + getBuildCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let buildCommand: Command = { cmd: "" }; + if (scripts?.build) { + buildCommand.cmd = scripts.build; + } else if (matchedFramework && matchedFramework.commands?.build) { + buildCommand = matchedFramework.commands.build; + } + buildCommand = this.replaceCommandPrefixWithPackageManager(buildCommand, packageManager); + + return buildCommand; + } + + getDevCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let devCommand: Command = { cmd: "", env: { NODE_ENV: "dev" } }; + if (scripts?.dev) { + devCommand.cmd = scripts.dev; + } else if (matchedFramework && matchedFramework.commands?.dev) { + devCommand = matchedFramework.commands.dev; + } + devCommand = this.replaceCommandPrefixWithPackageManager(devCommand, packageManager); + + return devCommand; + } + + getRunCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let runCommand: Command = { cmd: "", env: { NODE_ENV: "production" } }; + if (scripts?.start) { + runCommand.cmd = scripts.start; + } else if (matchedFramework && matchedFramework.commands?.run) { + runCommand = matchedFramework.commands.run; + } + runCommand = this.replaceCommandPrefixWithPackageManager(runCommand, packageManager); + + return runCommand; + } + + async analyseCodebase( + fs: FileSystem, + allFrameworkSpecs: FrameworkSpec[] + ): Promise { + try { + const packageJSONRaw = await readOrNull(fs, PACKAGE_JSON); + if (!packageJSONRaw) { + return null; + } + const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; + const packageManager = await this.getPackageManager(fs); + const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const dependencies = await this.getDependencies(fs, packageJSON, packageManager); + const matchedFramework = await frameworkMatcher( + NODE_RUNTIME_ID, + fs, + allFrameworkSpecs, + dependencies + ); + + const runtimeSpec: RuntimeSpec = { + id: NODE_RUNTIME_ID, + baseImage: nodeImageVersion, + packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), + installCommand: this.installCommand(packageManager), + detectedCommands: this.detectedCommands( + packageManager, + packageJSON.scripts, + matchedFramework + ), + }; + + return runtimeSpec; + } catch (error: any) { + throw new Error("Failed to analyseCodebase", error.message); + } + } +} From abf80efc7ad05f2ffdd001aa0435a48ef0a80e53 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:29:02 -0700 Subject: [PATCH 054/104] changes to desription name --- src/test/frameworks/compose/discover/filesystem.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index fac0de589fb..b0faf491231 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,7 +1,7 @@ import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; -describe("RepositoryFileSystem", () => { +describe("LocalFileSystem", () => { let fileSystem: MockFileSystem; before(() => { From 435c3fcbba6f17653ed52db48b85a7c6c8470ec8 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 055/104] Tests for runtime functionality --- .../compose/discover/runtime/node.ts | 45 ++-- .../compose/discover/runtime/node.spec.ts | 240 ++++++++++++++++++ 2 files changed, 266 insertions(+), 19 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 44849ffddf2..ef056968cc6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -8,14 +8,13 @@ import { join } from "path"; import { logger } from "../../../../logger"; import { FirebaseError } from "../../../../error"; -interface PackageJSON { +export interface PackageJSON { dependencies?: Record; devDependencies?: Record; scripts?: Record; - engines: Record; + engines?: Record; } -const NODE = "node"; const NODE_LATEST_BASE_IMAGE = "node:18-slim"; const NODE_RUNTIME_ID = "nodejs"; const PACKAGE_JSON = "package.json"; @@ -25,8 +24,8 @@ const YARN_LOCK = "yarn.lock"; const NPM = "npm"; export class NodejsRuntime implements Runtime { - private readonly runtimeName = NODE_RUNTIME_ID; private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + private readonly contentCache: Record = {}; // Checks if the codebase is using Node as runtime. async match(fs: FileSystem): Promise { @@ -37,18 +36,18 @@ export class NodejsRuntime implements Runtime { } getRuntimeName(): string { - return this.runtimeName; + return NODE_RUNTIME_ID; } - getNodeVersion(version: Record): string { + getNodeImage(version: Record | undefined): string { try { // If no version is mentioned explicitly, assuming application is compatible with latest version. if (!version) { return NODE_LATEST_BASE_IMAGE; } - const nodeVersion = version[NODE]; + const nodeVersion = version.node; // Splits version number `>=18..0.5` to `>=` and `18.0.5` - const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; const versionMatch = versionPattern.exec(nodeVersion); if (!versionMatch) { return NODE_LATEST_BASE_IMAGE; @@ -56,7 +55,7 @@ export class NodejsRuntime implements Runtime { const operator = versionMatch[1]; const versionNumber = versionMatch[2]; const majorVersion = parseInt(versionNumber.split(".")[0]); - if (!operator && majorVersion < 18) { + if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { throw new FirebaseError( "Unsupported node version number, only versions >= 18 are supported." ); @@ -80,24 +79,31 @@ export class NodejsRuntime implements Runtime { fs: FileSystem, packageJSON: PackageJSON ): Promise> { + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + let transitiveDependencies = {}; + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); if (!packageLockJSONRaw) { - return {}; + return directDependencies; } const packageLockJSON = JSON.parse(packageLockJSONRaw); - const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; - const directDependenciesKeys = Object.keys(directDependencies).map((x) => + const directDependencyNames = Object.keys(directDependencies).map((x) => join("node_modules", x) ); - let transitiveDependencies = {}; - directDependenciesKeys.forEach((key) => { - const deps = packageLockJSON.packages[key]["dependencies"]; - transitiveDependencies = { ...transitiveDependencies, ...deps }; + + directDependencyNames.forEach((directDepName) => { + const transitiveDeps = packageLockJSON.packages[directDepName].dependencies; + transitiveDependencies = { ...transitiveDependencies, ...transitiveDeps }; }); + return { ...directDependencies, ...transitiveDependencies }; } - async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + async getDependencies( + fs: FileSystem, + packageJSON: PackageJSON, + packageManager: string + ): Promise> { try { let dependencies = {}; if (packageManager === NPM) { @@ -155,6 +161,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } @@ -217,7 +224,7 @@ export class NodejsRuntime implements Runtime { } const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; const packageManager = await this.getPackageManager(fs); - const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const nodeImage = this.getNodeImage(packageJSON.engines); const dependencies = await this.getDependencies(fs, packageJSON, packageManager); const matchedFramework = await frameworkMatcher( NODE_RUNTIME_ID, @@ -228,7 +235,7 @@ export class NodejsRuntime implements Runtime { const runtimeSpec: RuntimeSpec = { id: NODE_RUNTIME_ID, - baseImage: nodeImageVersion, + baseImage: nodeImage, packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), installCommand: this.installCommand(packageManager), detectedCommands: this.detectedCommands( diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts index e69de29bb2d..e2ed74f9b24 100644 --- a/src/test/frameworks/compose/discover/runtime/node.spec.ts +++ b/src/test/frameworks/compose/discover/runtime/node.spec.ts @@ -0,0 +1,240 @@ +import { MockFileSystem } from "../mockFileSystem"; +import { expect } from "chai"; +import { + NodejsRuntime, + PackageJSON, +} from "../../../../../frameworks/compose/discover/runtime/node"; +import { FrameworkSpec } from "../../../../../frameworks/compose/discover/types"; + +describe("NodejsRuntime", () => { + let nodeJSRuntime: NodejsRuntime; + + before(() => { + nodeJSRuntime = new NodejsRuntime(); + }); + + describe("getNodeImage", () => { + it("should return a valid node Image", () => { + const version: Record = { + node: ">=18.5.4", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return node Image", () => { + const version: Record = { + node: "^18.0.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return latest node Image", () => { + const version: Record = { + node: "18.8.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + }); + + describe("getPackageManager", () => { + it("should return yarn package manager", async () => { + const fileSystem = new MockFileSystem({ + "yarn.lock": "It is test file", + }); + const actual = await nodeJSRuntime.getPackageManager(fileSystem); + const expected = "yarn"; + + expect(actual).to.equal(expected); + }); + }); + + describe("getDependencies", () => { + it("should return direct and transitive dependencies", async () => { + const fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/express": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/nodemon": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + "node_modules/mocha": { + dependencies: { + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }, + }, + }, + }), + }); + const packageJSON: PackageJSON = { + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }; + const actual = await nodeJSRuntime.getDependencies(fileSystem, packageJSON, "npm"); + const expected = { + express: "^4.18.2", + nodemon: "^2.0.12", + mocha: "^9.1.1", + accepts: "~1.3.8", + "array-flatten": "1.1.1", + chokidar: "^3.5.2", + debug: "^3.2.7", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("detectedCommands", () => { + it("should commands required to run the app.", () => { + const matchedFramework: FrameworkSpec = { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }; + + const scripts = { + build: "next build", + start: "next start", + }; + + const actual = nodeJSRuntime.detectedCommands("npm", scripts, matchedFramework); + const expected = { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("analyseCodebase", () => { + it("should return runtime specs", async () => { + const fileSystem = new MockFileSystem({ + "next.config.js": "For testing", + "next.config.ts": "For testing", + "package.json": JSON.stringify({ + scripts: { + build: "next build", + start: "next start", + }, + dependencies: { + next: "13.4.5", + react: "18.2.0", + }, + engines: { + node: ">=18.5.2", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/next": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/react": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + }, + }), + }); + + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [{ name: "express" }], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [{ name: "next" }], + requiredFiles: [["next.config.js"], "next.config.ts"], + embedsFrameworks: ["react"], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }, + ]; + + const actual = await nodeJSRuntime.analyseCodebase(fileSystem, allFrameworks); + const expected = { + id: "nodejs", + baseImage: "node:18-slim", + packageManagerInstallCommand: undefined, + installCommand: "npm ci", + detectedCommands: { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); +}); From 090e4fb953f5d37c015e53941501c92882b34fe9 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:00:42 -0700 Subject: [PATCH 056/104] Resolved error handling and test cases changes --- src/frameworks/compose/discover/filesystem.ts | 13 ++++---- .../compose/discover/filesystem.spec.ts | 8 +++-- .../compose/discover/mockFileSystem.ts | 32 ++++++++++++++++--- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 2e0f6b257c1..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -2,7 +2,7 @@ import { FileSystem } from "./types"; import { pathExists, readFile } from "fs-extra"; import * as path from "path"; import { FirebaseError } from "../../../error"; -import { logger } from "../../.."; +import { logger } from "../../../../src/logger"; /** * Find files or read file contents present in the directory. @@ -21,7 +21,7 @@ export class LocalFileSystem implements FileSystem { return this.existsCache[file]; } catch (error) { - throw new FirebaseError("Error occured while searching for file."); + throw new FirebaseError(`Error occured while searching for file: ${error}`); } } @@ -33,7 +33,7 @@ export class LocalFileSystem implements FileSystem { } return this.contentCache[file]; } catch (error) { - logger.log("Error occured while reading file contents."); + logger.error("Error occured while reading file contents."); throw error; } } @@ -45,10 +45,11 @@ export class LocalFileSystem implements FileSystem { export async function readOrNull(fs: FileSystem, path: string): Promise { try { return fs.read(path); - } catch (err: unknown) { - if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") { + } catch (err: any) { + if (err && typeof err === "object" && err?.code === "ENOENT") { + logger.debug("ENOENT error occured while reading file."); return null; } - throw new FirebaseError("Unknown error occured while trying to read file contents."); + throw new Error(`Unknown error occured while reading file: ${err}`); } } diff --git a/src/test/frameworks/compose/discover/filesystem.spec.ts b/src/test/frameworks/compose/discover/filesystem.spec.ts index b0faf491231..db1212b3393 100644 --- a/src/test/frameworks/compose/discover/filesystem.spec.ts +++ b/src/test/frameworks/compose/discover/filesystem.spec.ts @@ -1,7 +1,7 @@ import { MockFileSystem } from "./mockFileSystem"; import { expect } from "chai"; -describe("LocalFileSystem", () => { +describe("MockFileSystem", () => { let fileSystem: MockFileSystem; before(() => { @@ -23,13 +23,14 @@ describe("LocalFileSystem", () => { it("should return true if file exists in the directory ", async () => { const fileExists = await fileSystem.exists("package.json"); - expect(fileExists).to.equal(true); + expect(fileExists).to.be.true; + expect(fileSystem.getExistsCache("package.json")).to.be.true; }); it("should return false if file does not exist in the directory", async () => { const fileExists = await fileSystem.exists("nonexistent.txt"); - expect(fileExists).to.equal(false); + expect(fileExists).to.be.false; }); }); @@ -49,6 +50,7 @@ describe("LocalFileSystem", () => { }); expect(fileContent).to.equal(expected); + expect(fileSystem.getContentCache("package.json")).to.equal(expected); }); }); }); diff --git a/src/test/frameworks/compose/discover/mockFileSystem.ts b/src/test/frameworks/compose/discover/mockFileSystem.ts index 6f1a1f5f0a6..cdbf21d6159 100644 --- a/src/test/frameworks/compose/discover/mockFileSystem.ts +++ b/src/test/frameworks/compose/discover/mockFileSystem.ts @@ -1,16 +1,38 @@ import { FileSystem } from "../../../../frameworks/compose/discover/types"; export class MockFileSystem implements FileSystem { - constructor(private readonly mock: Record) {} + private readonly existsCache: Record = {}; + private readonly contentCache: Record = {}; + + constructor(private readonly fileSys: Record) {} exists(path: string): Promise { - return Promise.resolve(path in this.mock); + if (!(path in this.existsCache)) { + this.existsCache[path] = path in this.fileSys; + } + + return Promise.resolve(this.existsCache[path]); } read(path: string): Promise { - if (!(path in this.mock)) { - throw new Error("File not found in the mock file system."); + if (!(path in this.contentCache)) { + if (!(path in this.fileSys)) { + const err = new Error("File path not found"); + err.cause = "ENOENT"; + throw err; + } else { + this.contentCache[path] = this.fileSys[path]; + } } - return Promise.resolve(this.mock[path]); + + return Promise.resolve(this.contentCache[path]); + } + + getContentCache(path: string): string { + return this.contentCache[path]; + } + + getExistsCache(path: string): boolean { + return this.existsCache[path]; } } From d7e1ba18b6c3528e305b8b387ca5f72a24ade710 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:16:14 -0700 Subject: [PATCH 057/104] Resolved comments --- src/frameworks/compose/discover/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/compose/discover/types.ts b/src/frameworks/compose/discover/types.ts index 97fff3ea56c..677e054ec27 100644 --- a/src/frameworks/compose/discover/types.ts +++ b/src/frameworks/compose/discover/types.ts @@ -12,7 +12,7 @@ export interface Runtime { export interface Command { // Consider: string[] for series of commands that must execute successfully // in sequence. - cmd: string | string[]; + cmd: string; // Environment in which command is executed. env?: Record; From 23605aa82279f004b3f5652d2eea8d91ed28dec9 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:23:41 -0700 Subject: [PATCH 058/104] Error handling changes --- src/frameworks/compose/discover/frameworkMatcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index b8f6b63cd56..b9c43d7f1f6 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -94,7 +94,7 @@ export async function frameworkMatcher( } return allMatches[0]; - } catch (error) { - throw new FirebaseError("Failed to match the correct frameworkSpec"); + } catch (error: any) { + throw new FirebaseError(`Failed to match the correct frameworkSpec: ${error}`); } } From c831cf92fa75819477c821c3369e53c5e13c3a0f Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 059/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index ef056968cc6..64db9b1895c 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -72,6 +73,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; } @@ -109,6 +111,7 @@ export class NodejsRuntime implements Runtime { if (packageManager === NPM) { dependencies = await this.getDependenciesForNPM(fs, packageJSON); } + return dependencies; } catch (error: any) { throw new Error("Failed to getDependencies for the project", error.message); From ac3ff13f65aba2c88284f662c3e6b0396b003fcc Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 10:02:25 -0700 Subject: [PATCH 060/104] Error handling corrections --- src/frameworks/compose/discover/runtime/node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 64db9b1895c..8c22188cce6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -114,7 +114,8 @@ export class NodejsRuntime implements Runtime { return dependencies; } catch (error: any) { - throw new Error("Failed to getDependencies for the project", error.message); + logger.error("Failed to getDependencies for the project: ", error); + throw error; } } @@ -250,7 +251,8 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { - throw new Error("Failed to analyseCodebase", error.message); + logger.error("Failed to analyseCodebase: ", error); + throw error; } } } From 06eff9e1bdbb7346a88add87c1466f5b9fa00074 Mon Sep 17 00:00:00 2001 From: Yuchen Shi Date: Mon, 12 Jun 2023 13:14:45 -0700 Subject: [PATCH 061/104] Fix firebase-vscode/package-lock.json and add it to linting. (#5965) * Fix firebase-vscode/package-lock.json and add it to linting. * Update node-test.yml --- .github/workflows/node-test.yml | 21 ++++++++- firebase-vscode/package-lock.json | 74 ++++++++++--------------------- 2 files changed, 42 insertions(+), 53 deletions(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index 5a089572232..bf1bb24e8b5 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -192,13 +192,30 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: npm - cache-dependency-path: npm-shrinkwrap.json - run: npm i -g npm@9.5 # --ignore-scripts prevents the `prepare` script from being run. - run: npm install --package-lock-only --ignore-scripts - run: "git diff --exit-code -- npm-shrinkwrap.json || (echo 'Error: npm-shrinkwrap.json is changed during npm install! Please make sure to use npm >= 8 and commit npm-shrinkwrap.json.' && false)" + check-package-lock-vsce: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: + - "18" + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm i -g npm@9.5 + # --ignore-scripts prevents the `prepare` script from being run. + - run: "(cd firebase-vscode && npm install --package-lock-only --ignore-scripts)" + - run: "git diff --exit-code -- firebase-vscode/package-lock.json || (echo 'Error: firebase-vscode/package-lock.json is changed during npm install! Please make sure to use npm >= 8 and commit firebase-vscode/package-lock.json.' && false)" + check-json-schema: runs-on: ubuntu-latest diff --git a/firebase-vscode/package-lock.json b/firebase-vscode/package-lock.json index 8b4d3788633..a08c836efd6 100644 --- a/firebase-vscode/package-lock.json +++ b/firebase-vscode/package-lock.json @@ -1,12 +1,19 @@ { "name": "firebase-vscode", - "version": "0.0.7", + "version": "0.0.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "firebase-vscode", - "version": "0.0.7", + "version": "0.0.9", + "dependencies": { + "@vscode/codicons": "0.0.30", + "@vscode/webview-ui-toolkit": "^1.2.1", + "classnames": "^2.3.2", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, "devDependencies": { "@teamsupercell/typings-for-css-modules-loader": "^2.5.1", "@types/glob": "^8.0.0", @@ -17,10 +24,7 @@ "@types/vscode": "^1.69.0", "@typescript-eslint/eslint-plugin": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", - "@vscode/codicons": "0.0.30", "@vscode/test-electron": "^2.2.0", - "@vscode/webview-ui-toolkit": "^1.2.1", - "classnames": "^2.3.2", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", "eslint": "^8.28.0", @@ -30,8 +34,6 @@ "mini-css-extract-plugin": "^2.6.0", "mocha": "^10.1.0", "postcss-loader": "^7.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", "sass": "^1.52.0", "sass-loader": "^13.0.0", "string-replace-loader": "^3.1.0", @@ -277,14 +279,12 @@ "node_modules/@microsoft/fast-element": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/@microsoft/fast-element/-/fast-element-1.11.0.tgz", - "integrity": "sha512-VKJYMkS5zgzHHb66sY7AFpYv6IfFhXrjQcAyNgi2ivD65My1XOhtjfKez5ELcLFRJfgZNAxvI8kE69apXERTkw==", - "dev": true + "integrity": "sha512-VKJYMkS5zgzHHb66sY7AFpYv6IfFhXrjQcAyNgi2ivD65My1XOhtjfKez5ELcLFRJfgZNAxvI8kE69apXERTkw==" }, "node_modules/@microsoft/fast-foundation": { "version": "2.47.0", "resolved": "https://registry.npmjs.org/@microsoft/fast-foundation/-/fast-foundation-2.47.0.tgz", "integrity": "sha512-EyFuioaZQ9ngjUNRQi8R3dIPPsaNQdUOS+tP0G7b1MJRhXmQWIitBM6IeveQA6ZvXG6H21dqgrfEWlsYrUZ2sw==", - "dev": true, "dependencies": { "@microsoft/fast-element": "^1.11.0", "@microsoft/fast-web-utilities": "^5.4.1", @@ -296,7 +296,6 @@ "version": "0.1.48", "resolved": "https://registry.npmjs.org/@microsoft/fast-react-wrapper/-/fast-react-wrapper-0.1.48.tgz", "integrity": "sha512-9NvEjru9Kn5ZKjomAMX6v+eF0DR+eDkxKDwDfi+Wb73kTbrNzcnmlwd4diN15ygH97kldgj2+lpvI4CKLQQWLg==", - "dev": true, "dependencies": { "@microsoft/fast-element": "^1.9.0", "@microsoft/fast-foundation": "^2.41.1" @@ -309,7 +308,6 @@ "version": "5.4.1", "resolved": "https://registry.npmjs.org/@microsoft/fast-web-utilities/-/fast-web-utilities-5.4.1.tgz", "integrity": "sha512-ReWYncndjV3c8D8iq9tp7NcFNc1vbVHvcBFPME2nNFKNbS1XCesYZGlIlf3ot5EmuOXPlrzUHOWzQ2vFpIkqDg==", - "dev": true, "dependencies": { "exenv-es6": "^1.1.1" } @@ -673,8 +671,7 @@ "node_modules/@vscode/codicons": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.30.tgz", - "integrity": "sha512-/quu8pLXEyrShoDjTImQwJ2H28y1XhANigyw7E7JvN9NNWc3XCkoIWpcb/tUhdf7XQpopLVVYbkMjXpdPPuMXg==", - "dev": true + "integrity": "sha512-/quu8pLXEyrShoDjTImQwJ2H28y1XhANigyw7E7JvN9NNWc3XCkoIWpcb/tUhdf7XQpopLVVYbkMjXpdPPuMXg==" }, "node_modules/@vscode/test-electron": { "version": "2.2.3", @@ -695,7 +692,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-1.2.1.tgz", "integrity": "sha512-ZpVqLxoFWWk8mmAN7jr1v9yjD6NGBIoflAedNSusmaViqwHZ2znKBwAwcumLOlNlqmST6QMkiTVys7O8rzfd0w==", - "dev": true, "dependencies": { "@microsoft/fast-element": "^1.6.2", "@microsoft/fast-foundation": "^2.38.0", @@ -1394,8 +1390,7 @@ "node_modules/classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==", - "dev": true + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" }, "node_modules/cliui": { "version": "7.0.4", @@ -2210,8 +2205,7 @@ "node_modules/exenv-es6": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exenv-es6/-/exenv-es6-1.1.1.tgz", - "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==", - "dev": true + "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==" }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -3283,8 +3277,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -3460,7 +3453,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -4362,7 +4354,6 @@ "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "dev": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -4374,7 +4365,6 @@ "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "dev": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -4706,7 +4696,6 @@ "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dev": true, "dependencies": { "loose-envify": "^1.1.0" } @@ -5006,8 +4995,7 @@ "node_modules/tabbable": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz", - "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==", - "dev": true + "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==" }, "node_modules/tapable": { "version": "2.2.1", @@ -5137,8 +5125,7 @@ "node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -5856,14 +5843,12 @@ "@microsoft/fast-element": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/@microsoft/fast-element/-/fast-element-1.11.0.tgz", - "integrity": "sha512-VKJYMkS5zgzHHb66sY7AFpYv6IfFhXrjQcAyNgi2ivD65My1XOhtjfKez5ELcLFRJfgZNAxvI8kE69apXERTkw==", - "dev": true + "integrity": "sha512-VKJYMkS5zgzHHb66sY7AFpYv6IfFhXrjQcAyNgi2ivD65My1XOhtjfKez5ELcLFRJfgZNAxvI8kE69apXERTkw==" }, "@microsoft/fast-foundation": { "version": "2.47.0", "resolved": "https://registry.npmjs.org/@microsoft/fast-foundation/-/fast-foundation-2.47.0.tgz", "integrity": "sha512-EyFuioaZQ9ngjUNRQi8R3dIPPsaNQdUOS+tP0G7b1MJRhXmQWIitBM6IeveQA6ZvXG6H21dqgrfEWlsYrUZ2sw==", - "dev": true, "requires": { "@microsoft/fast-element": "^1.11.0", "@microsoft/fast-web-utilities": "^5.4.1", @@ -5875,7 +5860,6 @@ "version": "0.1.48", "resolved": "https://registry.npmjs.org/@microsoft/fast-react-wrapper/-/fast-react-wrapper-0.1.48.tgz", "integrity": "sha512-9NvEjru9Kn5ZKjomAMX6v+eF0DR+eDkxKDwDfi+Wb73kTbrNzcnmlwd4diN15ygH97kldgj2+lpvI4CKLQQWLg==", - "dev": true, "requires": { "@microsoft/fast-element": "^1.9.0", "@microsoft/fast-foundation": "^2.41.1" @@ -5885,7 +5869,6 @@ "version": "5.4.1", "resolved": "https://registry.npmjs.org/@microsoft/fast-web-utilities/-/fast-web-utilities-5.4.1.tgz", "integrity": "sha512-ReWYncndjV3c8D8iq9tp7NcFNc1vbVHvcBFPME2nNFKNbS1XCesYZGlIlf3ot5EmuOXPlrzUHOWzQ2vFpIkqDg==", - "dev": true, "requires": { "exenv-es6": "^1.1.1" } @@ -6146,8 +6129,7 @@ "@vscode/codicons": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.30.tgz", - "integrity": "sha512-/quu8pLXEyrShoDjTImQwJ2H28y1XhANigyw7E7JvN9NNWc3XCkoIWpcb/tUhdf7XQpopLVVYbkMjXpdPPuMXg==", - "dev": true + "integrity": "sha512-/quu8pLXEyrShoDjTImQwJ2H28y1XhANigyw7E7JvN9NNWc3XCkoIWpcb/tUhdf7XQpopLVVYbkMjXpdPPuMXg==" }, "@vscode/test-electron": { "version": "2.2.3", @@ -6165,7 +6147,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-1.2.1.tgz", "integrity": "sha512-ZpVqLxoFWWk8mmAN7jr1v9yjD6NGBIoflAedNSusmaViqwHZ2znKBwAwcumLOlNlqmST6QMkiTVys7O8rzfd0w==", - "dev": true, "requires": { "@microsoft/fast-element": "^1.6.2", "@microsoft/fast-foundation": "^2.38.0", @@ -6693,8 +6674,7 @@ "classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==", - "dev": true + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" }, "cliui": { "version": "7.0.4", @@ -7306,8 +7286,7 @@ "exenv-es6": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exenv-es6/-/exenv-es6-1.1.1.tgz", - "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==", - "dev": true + "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==" }, "fast-deep-equal": { "version": "3.1.3", @@ -8079,8 +8058,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "4.1.0", @@ -8218,7 +8196,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" } @@ -8862,7 +8839,6 @@ "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "dev": true, "requires": { "loose-envify": "^1.1.0" } @@ -8871,7 +8847,6 @@ "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "dev": true, "requires": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -9082,7 +9057,6 @@ "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dev": true, "requires": { "loose-envify": "^1.1.0" } @@ -9309,8 +9283,7 @@ "tabbable": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz", - "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==", - "dev": true + "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==" }, "tapable": { "version": "2.2.1", @@ -9392,8 +9365,7 @@ "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "tsutils": { "version": "3.21.0", From c3c3fb92a581e271802763693f71c82f2447fa78 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:00:31 -0700 Subject: [PATCH 062/104] Created node runtime to analyse framework --- src/frameworks/compose/discover/runtime/node.ts | 0 src/test/frameworks/compose/discover/runtime/node.spec.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/frameworks/compose/discover/runtime/node.ts create mode 100644 src/test/frameworks/compose/discover/runtime/node.spec.ts diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts new file mode 100644 index 00000000000..e69de29bb2d From ac7375f6af0fdb28ddcfe1df84e1e904d9928340 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 063/104] Added code for Node runtime --- .../compose/discover/runtime/node.ts | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index e69de29bb2d..44849ffddf2 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -0,0 +1,246 @@ +import { readOrNull } from "../filesystem"; +import { FileSystem, FrameworkSpec, Runtime } from "../types"; +import { RuntimeSpec } from "../types"; +import { frameworkMatcher } from "../frameworkMatcher"; +import { LifecycleCommands } from "../types"; +import { Command } from "../types"; +import { join } from "path"; +import { logger } from "../../../../logger"; +import { FirebaseError } from "../../../../error"; + +interface PackageJSON { + dependencies?: Record; + devDependencies?: Record; + scripts?: Record; + engines: Record; +} + +const NODE = "node"; +const NODE_LATEST_BASE_IMAGE = "node:18-slim"; +const NODE_RUNTIME_ID = "nodejs"; +const PACKAGE_JSON = "package.json"; +const PACKAGE_LOCK_JSON = "package-lock.json"; +const YARN = "yarn"; +const YARN_LOCK = "yarn.lock"; +const NPM = "npm"; + +export class NodejsRuntime implements Runtime { + private readonly runtimeName = NODE_RUNTIME_ID; + private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + + // Checks if the codebase is using Node as runtime. + async match(fs: FileSystem): Promise { + const areAllFilesPresent = await Promise.all( + this.runtimeRequiredFiles.map((file) => fs.exists(file)) + ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); + } + + getRuntimeName(): string { + return this.runtimeName; + } + + getNodeVersion(version: Record): string { + try { + // If no version is mentioned explicitly, assuming application is compatible with latest version. + if (!version) { + return NODE_LATEST_BASE_IMAGE; + } + const nodeVersion = version[NODE]; + // Splits version number `>=18..0.5` to `>=` and `18.0.5` + const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionMatch = versionPattern.exec(nodeVersion); + if (!versionMatch) { + return NODE_LATEST_BASE_IMAGE; + } + const operator = versionMatch[1]; + const versionNumber = versionMatch[2]; + const majorVersion = parseInt(versionNumber.split(".")[0]); + if (!operator && majorVersion < 18) { + throw new FirebaseError( + "Unsupported node version number, only versions >= 18 are supported." + ); + } + + return NODE_LATEST_BASE_IMAGE; + } catch (error) { + logger.error("Failed to getNodeVersion", error); + throw error; + } + } + + async getPackageManager(fs: FileSystem): Promise { + if (await fs.exists(YARN_LOCK)) { + return YARN; + } + return NPM; + } + + async getDependenciesForNPM( + fs: FileSystem, + packageJSON: PackageJSON + ): Promise> { + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); + if (!packageLockJSONRaw) { + return {}; + } + const packageLockJSON = JSON.parse(packageLockJSONRaw); + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + const directDependenciesKeys = Object.keys(directDependencies).map((x) => + join("node_modules", x) + ); + let transitiveDependencies = {}; + directDependenciesKeys.forEach((key) => { + const deps = packageLockJSON.packages[key]["dependencies"]; + transitiveDependencies = { ...transitiveDependencies, ...deps }; + }); + return { ...directDependencies, ...transitiveDependencies }; + } + + async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + try { + let dependencies = {}; + if (packageManager === NPM) { + dependencies = await this.getDependenciesForNPM(fs, packageJSON); + } + return dependencies; + } catch (error: any) { + throw new Error("Failed to getDependencies for the project", error.message); + } + } + + packageManagerInstallCommand(packageManager: string): string | undefined { + const packages: string[] = []; + if (packageManager === "yarn") { + packages.push("yarn"); + } + if (!packages.length) { + return undefined; + } + + return `npm install --global ${packages.join(" ")}`; + } + + installCommand(packageManager: string): string | undefined { + if (packageManager === "npm") { + return "npm ci"; + } else if (packageManager === "yarn") { + return "yarn install"; + } + + return undefined; + } + + detectedCommands( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): LifecycleCommands { + const commands: LifecycleCommands = { + build: this.getBuildCommand(packageManager, scripts, matchedFramework), + dev: this.getDevCommand(packageManager, scripts, matchedFramework), + run: this.getRunCommand(packageManager, scripts, matchedFramework), + }; + + return commands; + } + + // Converts the prefix of command to required packageManager. + // Ex: If packageManager is 'yarn' then converts `npm run build` to `yarn run build`. + replaceCommandPrefixWithPackageManager(command: Command, packageManager: string): Command { + if (command.cmd !== "") { + if (Array.isArray(command.cmd)) { + command.cmd.map((currCmd) => currCmd.replace(/^\S+/, packageManager)); + } else { + command.cmd.replace(/^\S+/, packageManager); + } + } + return command; + } + + getBuildCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let buildCommand: Command = { cmd: "" }; + if (scripts?.build) { + buildCommand.cmd = scripts.build; + } else if (matchedFramework && matchedFramework.commands?.build) { + buildCommand = matchedFramework.commands.build; + } + buildCommand = this.replaceCommandPrefixWithPackageManager(buildCommand, packageManager); + + return buildCommand; + } + + getDevCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let devCommand: Command = { cmd: "", env: { NODE_ENV: "dev" } }; + if (scripts?.dev) { + devCommand.cmd = scripts.dev; + } else if (matchedFramework && matchedFramework.commands?.dev) { + devCommand = matchedFramework.commands.dev; + } + devCommand = this.replaceCommandPrefixWithPackageManager(devCommand, packageManager); + + return devCommand; + } + + getRunCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let runCommand: Command = { cmd: "", env: { NODE_ENV: "production" } }; + if (scripts?.start) { + runCommand.cmd = scripts.start; + } else if (matchedFramework && matchedFramework.commands?.run) { + runCommand = matchedFramework.commands.run; + } + runCommand = this.replaceCommandPrefixWithPackageManager(runCommand, packageManager); + + return runCommand; + } + + async analyseCodebase( + fs: FileSystem, + allFrameworkSpecs: FrameworkSpec[] + ): Promise { + try { + const packageJSONRaw = await readOrNull(fs, PACKAGE_JSON); + if (!packageJSONRaw) { + return null; + } + const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; + const packageManager = await this.getPackageManager(fs); + const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const dependencies = await this.getDependencies(fs, packageJSON, packageManager); + const matchedFramework = await frameworkMatcher( + NODE_RUNTIME_ID, + fs, + allFrameworkSpecs, + dependencies + ); + + const runtimeSpec: RuntimeSpec = { + id: NODE_RUNTIME_ID, + baseImage: nodeImageVersion, + packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), + installCommand: this.installCommand(packageManager), + detectedCommands: this.detectedCommands( + packageManager, + packageJSON.scripts, + matchedFramework + ), + }; + + return runtimeSpec; + } catch (error: any) { + throw new Error("Failed to analyseCodebase", error.message); + } + } +} From eceb2833724d6438043bad3cc16d4259afe904a7 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 064/104] Tests for runtime functionality --- .../compose/discover/runtime/node.ts | 45 ++-- .../compose/discover/runtime/node.spec.ts | 240 ++++++++++++++++++ 2 files changed, 266 insertions(+), 19 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 44849ffddf2..ef056968cc6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -8,14 +8,13 @@ import { join } from "path"; import { logger } from "../../../../logger"; import { FirebaseError } from "../../../../error"; -interface PackageJSON { +export interface PackageJSON { dependencies?: Record; devDependencies?: Record; scripts?: Record; - engines: Record; + engines?: Record; } -const NODE = "node"; const NODE_LATEST_BASE_IMAGE = "node:18-slim"; const NODE_RUNTIME_ID = "nodejs"; const PACKAGE_JSON = "package.json"; @@ -25,8 +24,8 @@ const YARN_LOCK = "yarn.lock"; const NPM = "npm"; export class NodejsRuntime implements Runtime { - private readonly runtimeName = NODE_RUNTIME_ID; private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + private readonly contentCache: Record = {}; // Checks if the codebase is using Node as runtime. async match(fs: FileSystem): Promise { @@ -37,18 +36,18 @@ export class NodejsRuntime implements Runtime { } getRuntimeName(): string { - return this.runtimeName; + return NODE_RUNTIME_ID; } - getNodeVersion(version: Record): string { + getNodeImage(version: Record | undefined): string { try { // If no version is mentioned explicitly, assuming application is compatible with latest version. if (!version) { return NODE_LATEST_BASE_IMAGE; } - const nodeVersion = version[NODE]; + const nodeVersion = version.node; // Splits version number `>=18..0.5` to `>=` and `18.0.5` - const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; const versionMatch = versionPattern.exec(nodeVersion); if (!versionMatch) { return NODE_LATEST_BASE_IMAGE; @@ -56,7 +55,7 @@ export class NodejsRuntime implements Runtime { const operator = versionMatch[1]; const versionNumber = versionMatch[2]; const majorVersion = parseInt(versionNumber.split(".")[0]); - if (!operator && majorVersion < 18) { + if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { throw new FirebaseError( "Unsupported node version number, only versions >= 18 are supported." ); @@ -80,24 +79,31 @@ export class NodejsRuntime implements Runtime { fs: FileSystem, packageJSON: PackageJSON ): Promise> { + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + let transitiveDependencies = {}; + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); if (!packageLockJSONRaw) { - return {}; + return directDependencies; } const packageLockJSON = JSON.parse(packageLockJSONRaw); - const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; - const directDependenciesKeys = Object.keys(directDependencies).map((x) => + const directDependencyNames = Object.keys(directDependencies).map((x) => join("node_modules", x) ); - let transitiveDependencies = {}; - directDependenciesKeys.forEach((key) => { - const deps = packageLockJSON.packages[key]["dependencies"]; - transitiveDependencies = { ...transitiveDependencies, ...deps }; + + directDependencyNames.forEach((directDepName) => { + const transitiveDeps = packageLockJSON.packages[directDepName].dependencies; + transitiveDependencies = { ...transitiveDependencies, ...transitiveDeps }; }); + return { ...directDependencies, ...transitiveDependencies }; } - async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + async getDependencies( + fs: FileSystem, + packageJSON: PackageJSON, + packageManager: string + ): Promise> { try { let dependencies = {}; if (packageManager === NPM) { @@ -155,6 +161,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } @@ -217,7 +224,7 @@ export class NodejsRuntime implements Runtime { } const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; const packageManager = await this.getPackageManager(fs); - const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const nodeImage = this.getNodeImage(packageJSON.engines); const dependencies = await this.getDependencies(fs, packageJSON, packageManager); const matchedFramework = await frameworkMatcher( NODE_RUNTIME_ID, @@ -228,7 +235,7 @@ export class NodejsRuntime implements Runtime { const runtimeSpec: RuntimeSpec = { id: NODE_RUNTIME_ID, - baseImage: nodeImageVersion, + baseImage: nodeImage, packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), installCommand: this.installCommand(packageManager), detectedCommands: this.detectedCommands( diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts index e69de29bb2d..e2ed74f9b24 100644 --- a/src/test/frameworks/compose/discover/runtime/node.spec.ts +++ b/src/test/frameworks/compose/discover/runtime/node.spec.ts @@ -0,0 +1,240 @@ +import { MockFileSystem } from "../mockFileSystem"; +import { expect } from "chai"; +import { + NodejsRuntime, + PackageJSON, +} from "../../../../../frameworks/compose/discover/runtime/node"; +import { FrameworkSpec } from "../../../../../frameworks/compose/discover/types"; + +describe("NodejsRuntime", () => { + let nodeJSRuntime: NodejsRuntime; + + before(() => { + nodeJSRuntime = new NodejsRuntime(); + }); + + describe("getNodeImage", () => { + it("should return a valid node Image", () => { + const version: Record = { + node: ">=18.5.4", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return node Image", () => { + const version: Record = { + node: "^18.0.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return latest node Image", () => { + const version: Record = { + node: "18.8.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + }); + + describe("getPackageManager", () => { + it("should return yarn package manager", async () => { + const fileSystem = new MockFileSystem({ + "yarn.lock": "It is test file", + }); + const actual = await nodeJSRuntime.getPackageManager(fileSystem); + const expected = "yarn"; + + expect(actual).to.equal(expected); + }); + }); + + describe("getDependencies", () => { + it("should return direct and transitive dependencies", async () => { + const fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/express": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/nodemon": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + "node_modules/mocha": { + dependencies: { + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }, + }, + }, + }), + }); + const packageJSON: PackageJSON = { + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }; + const actual = await nodeJSRuntime.getDependencies(fileSystem, packageJSON, "npm"); + const expected = { + express: "^4.18.2", + nodemon: "^2.0.12", + mocha: "^9.1.1", + accepts: "~1.3.8", + "array-flatten": "1.1.1", + chokidar: "^3.5.2", + debug: "^3.2.7", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("detectedCommands", () => { + it("should commands required to run the app.", () => { + const matchedFramework: FrameworkSpec = { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }; + + const scripts = { + build: "next build", + start: "next start", + }; + + const actual = nodeJSRuntime.detectedCommands("npm", scripts, matchedFramework); + const expected = { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("analyseCodebase", () => { + it("should return runtime specs", async () => { + const fileSystem = new MockFileSystem({ + "next.config.js": "For testing", + "next.config.ts": "For testing", + "package.json": JSON.stringify({ + scripts: { + build: "next build", + start: "next start", + }, + dependencies: { + next: "13.4.5", + react: "18.2.0", + }, + engines: { + node: ">=18.5.2", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/next": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/react": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + }, + }), + }); + + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [{ name: "express" }], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [{ name: "next" }], + requiredFiles: [["next.config.js"], "next.config.ts"], + embedsFrameworks: ["react"], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }, + ]; + + const actual = await nodeJSRuntime.analyseCodebase(fileSystem, allFrameworks); + const expected = { + id: "nodejs", + baseImage: "node:18-slim", + packageManagerInstallCommand: undefined, + installCommand: "npm ci", + detectedCommands: { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); +}); From 55655566f138a3abb7efec20545813bfea2768d9 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 065/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index ef056968cc6..64db9b1895c 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -72,6 +73,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; } @@ -109,6 +111,7 @@ export class NodejsRuntime implements Runtime { if (packageManager === NPM) { dependencies = await this.getDependenciesForNPM(fs, packageJSON); } + return dependencies; } catch (error: any) { throw new Error("Failed to getDependencies for the project", error.message); From 822fc93b0d79dc6a4601df2e9f67f1bb256659b4 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 10:02:25 -0700 Subject: [PATCH 066/104] Error handling corrections --- src/frameworks/compose/discover/runtime/node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 64db9b1895c..8c22188cce6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -114,7 +114,8 @@ export class NodejsRuntime implements Runtime { return dependencies; } catch (error: any) { - throw new Error("Failed to getDependencies for the project", error.message); + logger.error("Failed to getDependencies for the project: ", error); + throw error; } } @@ -250,7 +251,8 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { - throw new Error("Failed to analyseCodebase", error.message); + logger.error("Failed to analyseCodebase: ", error); + throw error; } } } From cc6f4d9c61a3573a834c627de6cdfd93e225c1d9 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 13:25:17 -0700 Subject: [PATCH 067/104] Error handling --- .../compose/discover/runtime/node.ts | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 8c22188cce6..a6d686b014e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -41,32 +41,27 @@ export class NodejsRuntime implements Runtime { } getNodeImage(version: Record | undefined): string { - try { - // If no version is mentioned explicitly, assuming application is compatible with latest version. - if (!version) { - return NODE_LATEST_BASE_IMAGE; - } - const nodeVersion = version.node; - // Splits version number `>=18..0.5` to `>=` and `18.0.5` - const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; - const versionMatch = versionPattern.exec(nodeVersion); - if (!versionMatch) { - return NODE_LATEST_BASE_IMAGE; - } - const operator = versionMatch[1]; - const versionNumber = versionMatch[2]; - const majorVersion = parseInt(versionNumber.split(".")[0]); - if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { - throw new FirebaseError( - "Unsupported node version number, only versions >= 18 are supported." - ); - } - + // If no version is mentioned explicitly, assuming application is compatible with latest version. + if (!version) { return NODE_LATEST_BASE_IMAGE; - } catch (error) { - logger.error("Failed to getNodeVersion", error); - throw error; } + const nodeVersion = version.node; + // Splits version number `>=18..0.5` to `>=` and `18.0.5` + const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; + const versionMatch = versionPattern.exec(nodeVersion); + if (!versionMatch) { + return NODE_LATEST_BASE_IMAGE; + } + const operator = versionMatch[1]; + const versionNumber = versionMatch[2]; + const majorVersion = parseInt(versionNumber.split(".")[0]); + if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { + throw new FirebaseError( + "Unsupported node version number, only versions >= 18 are supported." + ); + } + + return NODE_LATEST_BASE_IMAGE; } async getPackageManager(fs: FileSystem): Promise { @@ -114,7 +109,7 @@ export class NodejsRuntime implements Runtime { return dependencies; } catch (error: any) { - logger.error("Failed to getDependencies for the project: ", error); + logger.error("Error while reading dependencies for the project: ", error); throw error; } } @@ -251,8 +246,7 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { - logger.error("Failed to analyseCodebase: ", error); - throw error; + throw new FirebaseError(`Failed to indentify commands for codebase: ${error}`); } } } From 43e63c3311c81a0351ba2baccb3ddda3d93a0e1d Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Wed, 14 Jun 2023 08:12:54 -0700 Subject: [PATCH 068/104] Resolved comments --- .../compose/discover/frameworkMatcher.ts | 20 +++++++---- .../compose/discover/frameworkMatcher.spec.ts | 33 ++----------------- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index a7a1968e2fb..ffe203efa4c 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -2,6 +2,9 @@ import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; import { logger } from "../../../logger"; +/** + * + */ export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], dependencies: Record @@ -13,6 +16,9 @@ export function filterFrameworksWithDependencies( }); } +/** + * + */ export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem @@ -49,23 +55,25 @@ export async function filterFrameworksWithFiles( /** * Embeded frameworks help to resolve tiebreakers when multiple frameworks are discovered. * Ex: "next" embeds "react", so if both frameworks are discovered, - * we can suggest "next" commands by removing embeded framework(react). + * we can suggest "next" commands by removing its embeded framework (react). */ export function removeEmbededFrameworks(allFrameworkSpecs: FrameworkSpec[]): FrameworkSpec[] { const embededFrameworkSet: Set = new Set(); - allFrameworkSpecs.forEach((framework) => { + for (const framework of allFrameworkSpecs) { if (!framework.embedsFrameworks) { - return; + continue; } - framework.embedsFrameworks.forEach((item) => embededFrameworkSet.add(item)); - }); + for (const item of framework.embedsFrameworks) { + embededFrameworkSet.add(item); + } + } return allFrameworkSpecs.filter((item) => !embededFrameworkSet.has(item.id)); } /** - * Identifies the correct FrameworkSpec for the codebase. + * Identifies the best FrameworkSpec for the codebase. */ export async function frameworkMatcher( runtime: string, diff --git a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts index aa6c9823f52..bb80b326fe6 100644 --- a/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts +++ b/src/test/frameworks/compose/discover/frameworkMatcher.spec.ts @@ -89,16 +89,9 @@ describe("frameworkMatcher", () => { embedsFrameworks: ["react"], }, ]; - const notExpect: FrameworkSpec[] = [ - { - id: "react", - runtime: "nodejs", - requiredDependencies: [], - }, - ]; expect(actual).to.have.deep.members(expected); - expect(actual).to.not.have.deep.members(notExpect); + expect(actual).to.have.length(2); }); }); @@ -128,17 +121,8 @@ describe("frameworkMatcher", () => { }, ]; - const notExpect: FrameworkSpec[] = [ - { - id: "next", - runtime: "nodejs", - requiredDependencies: [], - requiredFiles: [["next.config.js"], "next.config.ts"], - }, - ]; - expect(actual).to.have.deep.members(expected); - expect(actual).to.not.have.members(notExpect); + expect(actual).to.have.length(1); }); }); @@ -179,20 +163,9 @@ describe("frameworkMatcher", () => { ], }, ]; - const notExpect: FrameworkSpec[] = [ - { - id: "next", - runtime: "nodejs", - requiredDependencies: [ - { - name: "next", - }, - ], - }, - ]; expect(actual).to.have.deep.members(expected); - expect(actual).to.not.have.deep.members(notExpect); + expect(actual).to.have.length(1); }); }); }); From 4d764c41afd1e1c89dde207e17c0840709018452 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:00:31 -0700 Subject: [PATCH 069/104] Created node runtime to analyse framework --- src/frameworks/compose/discover/runtime/node.ts | 0 src/test/frameworks/compose/discover/runtime/node.spec.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/frameworks/compose/discover/runtime/node.ts create mode 100644 src/test/frameworks/compose/discover/runtime/node.spec.ts diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts new file mode 100644 index 00000000000..e69de29bb2d From c1e98b0623d94d219444ddc329d993e041d42dab Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 070/104] Added code for Node runtime --- .../compose/discover/runtime/node.ts | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index e69de29bb2d..44849ffddf2 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -0,0 +1,246 @@ +import { readOrNull } from "../filesystem"; +import { FileSystem, FrameworkSpec, Runtime } from "../types"; +import { RuntimeSpec } from "../types"; +import { frameworkMatcher } from "../frameworkMatcher"; +import { LifecycleCommands } from "../types"; +import { Command } from "../types"; +import { join } from "path"; +import { logger } from "../../../../logger"; +import { FirebaseError } from "../../../../error"; + +interface PackageJSON { + dependencies?: Record; + devDependencies?: Record; + scripts?: Record; + engines: Record; +} + +const NODE = "node"; +const NODE_LATEST_BASE_IMAGE = "node:18-slim"; +const NODE_RUNTIME_ID = "nodejs"; +const PACKAGE_JSON = "package.json"; +const PACKAGE_LOCK_JSON = "package-lock.json"; +const YARN = "yarn"; +const YARN_LOCK = "yarn.lock"; +const NPM = "npm"; + +export class NodejsRuntime implements Runtime { + private readonly runtimeName = NODE_RUNTIME_ID; + private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + + // Checks if the codebase is using Node as runtime. + async match(fs: FileSystem): Promise { + const areAllFilesPresent = await Promise.all( + this.runtimeRequiredFiles.map((file) => fs.exists(file)) + ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); + } + + getRuntimeName(): string { + return this.runtimeName; + } + + getNodeVersion(version: Record): string { + try { + // If no version is mentioned explicitly, assuming application is compatible with latest version. + if (!version) { + return NODE_LATEST_BASE_IMAGE; + } + const nodeVersion = version[NODE]; + // Splits version number `>=18..0.5` to `>=` and `18.0.5` + const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionMatch = versionPattern.exec(nodeVersion); + if (!versionMatch) { + return NODE_LATEST_BASE_IMAGE; + } + const operator = versionMatch[1]; + const versionNumber = versionMatch[2]; + const majorVersion = parseInt(versionNumber.split(".")[0]); + if (!operator && majorVersion < 18) { + throw new FirebaseError( + "Unsupported node version number, only versions >= 18 are supported." + ); + } + + return NODE_LATEST_BASE_IMAGE; + } catch (error) { + logger.error("Failed to getNodeVersion", error); + throw error; + } + } + + async getPackageManager(fs: FileSystem): Promise { + if (await fs.exists(YARN_LOCK)) { + return YARN; + } + return NPM; + } + + async getDependenciesForNPM( + fs: FileSystem, + packageJSON: PackageJSON + ): Promise> { + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); + if (!packageLockJSONRaw) { + return {}; + } + const packageLockJSON = JSON.parse(packageLockJSONRaw); + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + const directDependenciesKeys = Object.keys(directDependencies).map((x) => + join("node_modules", x) + ); + let transitiveDependencies = {}; + directDependenciesKeys.forEach((key) => { + const deps = packageLockJSON.packages[key]["dependencies"]; + transitiveDependencies = { ...transitiveDependencies, ...deps }; + }); + return { ...directDependencies, ...transitiveDependencies }; + } + + async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + try { + let dependencies = {}; + if (packageManager === NPM) { + dependencies = await this.getDependenciesForNPM(fs, packageJSON); + } + return dependencies; + } catch (error: any) { + throw new Error("Failed to getDependencies for the project", error.message); + } + } + + packageManagerInstallCommand(packageManager: string): string | undefined { + const packages: string[] = []; + if (packageManager === "yarn") { + packages.push("yarn"); + } + if (!packages.length) { + return undefined; + } + + return `npm install --global ${packages.join(" ")}`; + } + + installCommand(packageManager: string): string | undefined { + if (packageManager === "npm") { + return "npm ci"; + } else if (packageManager === "yarn") { + return "yarn install"; + } + + return undefined; + } + + detectedCommands( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): LifecycleCommands { + const commands: LifecycleCommands = { + build: this.getBuildCommand(packageManager, scripts, matchedFramework), + dev: this.getDevCommand(packageManager, scripts, matchedFramework), + run: this.getRunCommand(packageManager, scripts, matchedFramework), + }; + + return commands; + } + + // Converts the prefix of command to required packageManager. + // Ex: If packageManager is 'yarn' then converts `npm run build` to `yarn run build`. + replaceCommandPrefixWithPackageManager(command: Command, packageManager: string): Command { + if (command.cmd !== "") { + if (Array.isArray(command.cmd)) { + command.cmd.map((currCmd) => currCmd.replace(/^\S+/, packageManager)); + } else { + command.cmd.replace(/^\S+/, packageManager); + } + } + return command; + } + + getBuildCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let buildCommand: Command = { cmd: "" }; + if (scripts?.build) { + buildCommand.cmd = scripts.build; + } else if (matchedFramework && matchedFramework.commands?.build) { + buildCommand = matchedFramework.commands.build; + } + buildCommand = this.replaceCommandPrefixWithPackageManager(buildCommand, packageManager); + + return buildCommand; + } + + getDevCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let devCommand: Command = { cmd: "", env: { NODE_ENV: "dev" } }; + if (scripts?.dev) { + devCommand.cmd = scripts.dev; + } else if (matchedFramework && matchedFramework.commands?.dev) { + devCommand = matchedFramework.commands.dev; + } + devCommand = this.replaceCommandPrefixWithPackageManager(devCommand, packageManager); + + return devCommand; + } + + getRunCommand( + packageManager: string, + scripts: Record | undefined, + matchedFramework: FrameworkSpec | null + ): Command { + let runCommand: Command = { cmd: "", env: { NODE_ENV: "production" } }; + if (scripts?.start) { + runCommand.cmd = scripts.start; + } else if (matchedFramework && matchedFramework.commands?.run) { + runCommand = matchedFramework.commands.run; + } + runCommand = this.replaceCommandPrefixWithPackageManager(runCommand, packageManager); + + return runCommand; + } + + async analyseCodebase( + fs: FileSystem, + allFrameworkSpecs: FrameworkSpec[] + ): Promise { + try { + const packageJSONRaw = await readOrNull(fs, PACKAGE_JSON); + if (!packageJSONRaw) { + return null; + } + const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; + const packageManager = await this.getPackageManager(fs); + const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const dependencies = await this.getDependencies(fs, packageJSON, packageManager); + const matchedFramework = await frameworkMatcher( + NODE_RUNTIME_ID, + fs, + allFrameworkSpecs, + dependencies + ); + + const runtimeSpec: RuntimeSpec = { + id: NODE_RUNTIME_ID, + baseImage: nodeImageVersion, + packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), + installCommand: this.installCommand(packageManager), + detectedCommands: this.detectedCommands( + packageManager, + packageJSON.scripts, + matchedFramework + ), + }; + + return runtimeSpec; + } catch (error: any) { + throw new Error("Failed to analyseCodebase", error.message); + } + } +} From aea01982e44d0d38b50b902d15417013da24cd74 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 071/104] Tests for runtime functionality --- .../compose/discover/runtime/node.ts | 45 ++-- .../compose/discover/runtime/node.spec.ts | 240 ++++++++++++++++++ 2 files changed, 266 insertions(+), 19 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 44849ffddf2..ef056968cc6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -8,14 +8,13 @@ import { join } from "path"; import { logger } from "../../../../logger"; import { FirebaseError } from "../../../../error"; -interface PackageJSON { +export interface PackageJSON { dependencies?: Record; devDependencies?: Record; scripts?: Record; - engines: Record; + engines?: Record; } -const NODE = "node"; const NODE_LATEST_BASE_IMAGE = "node:18-slim"; const NODE_RUNTIME_ID = "nodejs"; const PACKAGE_JSON = "package.json"; @@ -25,8 +24,8 @@ const YARN_LOCK = "yarn.lock"; const NPM = "npm"; export class NodejsRuntime implements Runtime { - private readonly runtimeName = NODE_RUNTIME_ID; private readonly runtimeRequiredFiles: string[] = [PACKAGE_JSON]; + private readonly contentCache: Record = {}; // Checks if the codebase is using Node as runtime. async match(fs: FileSystem): Promise { @@ -37,18 +36,18 @@ export class NodejsRuntime implements Runtime { } getRuntimeName(): string { - return this.runtimeName; + return NODE_RUNTIME_ID; } - getNodeVersion(version: Record): string { + getNodeImage(version: Record | undefined): string { try { // If no version is mentioned explicitly, assuming application is compatible with latest version. if (!version) { return NODE_LATEST_BASE_IMAGE; } - const nodeVersion = version[NODE]; + const nodeVersion = version.node; // Splits version number `>=18..0.5` to `>=` and `18.0.5` - const versionPattern = /^([>=<]+)?(\d+\.\d+\.\d+)$/; + const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; const versionMatch = versionPattern.exec(nodeVersion); if (!versionMatch) { return NODE_LATEST_BASE_IMAGE; @@ -56,7 +55,7 @@ export class NodejsRuntime implements Runtime { const operator = versionMatch[1]; const versionNumber = versionMatch[2]; const majorVersion = parseInt(versionNumber.split(".")[0]); - if (!operator && majorVersion < 18) { + if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { throw new FirebaseError( "Unsupported node version number, only versions >= 18 are supported." ); @@ -80,24 +79,31 @@ export class NodejsRuntime implements Runtime { fs: FileSystem, packageJSON: PackageJSON ): Promise> { + const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; + let transitiveDependencies = {}; + const packageLockJSONRaw = await readOrNull(fs, PACKAGE_LOCK_JSON); if (!packageLockJSONRaw) { - return {}; + return directDependencies; } const packageLockJSON = JSON.parse(packageLockJSONRaw); - const directDependencies = { ...packageJSON.dependencies, ...packageJSON.devDependencies }; - const directDependenciesKeys = Object.keys(directDependencies).map((x) => + const directDependencyNames = Object.keys(directDependencies).map((x) => join("node_modules", x) ); - let transitiveDependencies = {}; - directDependenciesKeys.forEach((key) => { - const deps = packageLockJSON.packages[key]["dependencies"]; - transitiveDependencies = { ...transitiveDependencies, ...deps }; + + directDependencyNames.forEach((directDepName) => { + const transitiveDeps = packageLockJSON.packages[directDepName].dependencies; + transitiveDependencies = { ...transitiveDependencies, ...transitiveDeps }; }); + return { ...directDependencies, ...transitiveDependencies }; } - async getDependencies(fs: FileSystem, packageJSON: PackageJSON, packageManager: string) { + async getDependencies( + fs: FileSystem, + packageJSON: PackageJSON, + packageManager: string + ): Promise> { try { let dependencies = {}; if (packageManager === NPM) { @@ -155,6 +161,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } @@ -217,7 +224,7 @@ export class NodejsRuntime implements Runtime { } const packageJSON = JSON.parse(packageJSONRaw) as PackageJSON; const packageManager = await this.getPackageManager(fs); - const nodeImageVersion = this.getNodeVersion(packageJSON.engines); + const nodeImage = this.getNodeImage(packageJSON.engines); const dependencies = await this.getDependencies(fs, packageJSON, packageManager); const matchedFramework = await frameworkMatcher( NODE_RUNTIME_ID, @@ -228,7 +235,7 @@ export class NodejsRuntime implements Runtime { const runtimeSpec: RuntimeSpec = { id: NODE_RUNTIME_ID, - baseImage: nodeImageVersion, + baseImage: nodeImage, packageManagerInstallCommand: this.packageManagerInstallCommand(packageManager), installCommand: this.installCommand(packageManager), detectedCommands: this.detectedCommands( diff --git a/src/test/frameworks/compose/discover/runtime/node.spec.ts b/src/test/frameworks/compose/discover/runtime/node.spec.ts index e69de29bb2d..e2ed74f9b24 100644 --- a/src/test/frameworks/compose/discover/runtime/node.spec.ts +++ b/src/test/frameworks/compose/discover/runtime/node.spec.ts @@ -0,0 +1,240 @@ +import { MockFileSystem } from "../mockFileSystem"; +import { expect } from "chai"; +import { + NodejsRuntime, + PackageJSON, +} from "../../../../../frameworks/compose/discover/runtime/node"; +import { FrameworkSpec } from "../../../../../frameworks/compose/discover/types"; + +describe("NodejsRuntime", () => { + let nodeJSRuntime: NodejsRuntime; + + before(() => { + nodeJSRuntime = new NodejsRuntime(); + }); + + describe("getNodeImage", () => { + it("should return a valid node Image", () => { + const version: Record = { + node: ">=18.5.4", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return node Image", () => { + const version: Record = { + node: "^18.0.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + + it("should return latest node Image", () => { + const version: Record = { + node: "18.8.2", + }; + const actualImage = nodeJSRuntime.getNodeImage(version); + const expectedImage = "node:18-slim"; + + expect(actualImage).to.deep.equal(expectedImage); + }); + }); + + describe("getPackageManager", () => { + it("should return yarn package manager", async () => { + const fileSystem = new MockFileSystem({ + "yarn.lock": "It is test file", + }); + const actual = await nodeJSRuntime.getPackageManager(fileSystem); + const expected = "yarn"; + + expect(actual).to.equal(expected); + }); + }); + + describe("getDependencies", () => { + it("should return direct and transitive dependencies", async () => { + const fileSystem = new MockFileSystem({ + "package.json": JSON.stringify({ + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/express": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/nodemon": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + "node_modules/mocha": { + dependencies: { + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }, + }, + }, + }), + }); + const packageJSON: PackageJSON = { + dependencies: { + express: "^4.18.2", + }, + devDependencies: { + nodemon: "^2.0.12", + mocha: "^9.1.1", + }, + }; + const actual = await nodeJSRuntime.getDependencies(fileSystem, packageJSON, "npm"); + const expected = { + express: "^4.18.2", + nodemon: "^2.0.12", + mocha: "^9.1.1", + accepts: "~1.3.8", + "array-flatten": "1.1.1", + chokidar: "^3.5.2", + debug: "^3.2.7", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("detectedCommands", () => { + it("should commands required to run the app.", () => { + const matchedFramework: FrameworkSpec = { + id: "next", + runtime: "nodejs", + requiredDependencies: [], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }; + + const scripts = { + build: "next build", + start: "next start", + }; + + const actual = nodeJSRuntime.detectedCommands("npm", scripts, matchedFramework); + const expected = { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); + + describe("analyseCodebase", () => { + it("should return runtime specs", async () => { + const fileSystem = new MockFileSystem({ + "next.config.js": "For testing", + "next.config.ts": "For testing", + "package.json": JSON.stringify({ + scripts: { + build: "next build", + start: "next start", + }, + dependencies: { + next: "13.4.5", + react: "18.2.0", + }, + engines: { + node: ">=18.5.2", + }, + }), + "package-lock.json": JSON.stringify({ + packages: { + "node_modules/next": { + dependencies: { + accepts: "~1.3.8", + "array-flatten": "1.1.1", + }, + }, + "node_modules/react": { + dependencies: { + chokidar: "^3.5.2", + debug: "^3.2.7", + }, + }, + }, + }), + }); + + const allFrameworks: FrameworkSpec[] = [ + { + id: "express", + runtime: "nodejs", + requiredDependencies: [{ name: "express" }], + }, + { + id: "next", + runtime: "nodejs", + requiredDependencies: [{ name: "next" }], + requiredFiles: [["next.config.js"], "next.config.ts"], + embedsFrameworks: ["react"], + commands: { + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + }, + }, + ]; + + const actual = await nodeJSRuntime.analyseCodebase(fileSystem, allFrameworks); + const expected = { + id: "nodejs", + baseImage: "node:18-slim", + packageManagerInstallCommand: undefined, + installCommand: "npm ci", + detectedCommands: { + build: { + cmd: "next build", + }, + dev: { + cmd: "next dev", + env: { NODE_ENV: "dev" }, + }, + run: { + cmd: "next start", + env: { NODE_ENV: "production" }, + }, + }, + }; + + expect(actual).to.deep.equal(expected); + }); + }); +}); From 3a1628f7bb4e2067f4e8e62cd76f2ccb8fd012db Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 072/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index ef056968cc6..64db9b1895c 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -72,6 +73,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; } @@ -109,6 +111,7 @@ export class NodejsRuntime implements Runtime { if (packageManager === NPM) { dependencies = await this.getDependenciesForNPM(fs, packageJSON); } + return dependencies; } catch (error: any) { throw new Error("Failed to getDependencies for the project", error.message); From 8abf35bc3bd403949969bf5035e861f0fbc1649a Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 10:02:25 -0700 Subject: [PATCH 073/104] Error handling corrections --- src/frameworks/compose/discover/runtime/node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 64db9b1895c..8c22188cce6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -114,7 +114,8 @@ export class NodejsRuntime implements Runtime { return dependencies; } catch (error: any) { - throw new Error("Failed to getDependencies for the project", error.message); + logger.error("Failed to getDependencies for the project: ", error); + throw error; } } @@ -250,7 +251,8 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { - throw new Error("Failed to analyseCodebase", error.message); + logger.error("Failed to analyseCodebase: ", error); + throw error; } } } From f29eae78e0cdd082d7580ead075915782c6b326e Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:28:37 -0700 Subject: [PATCH 074/104] Removed comments and modified error handling. --- src/frameworks/compose/discover/filesystem.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index b2c7b7f9b47..88cc08dc23e 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -50,6 +50,11 @@ export async function readOrNull(fs: FileSystem, path: string): Promise>>>>>> 48063902 (Removed comments and modified error handling.) } } From 0a8e4444f2bcdb124f127652d6e8e45633006a2e Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 18:00:25 -0700 Subject: [PATCH 075/104] Resolved indentation issues --- src/frameworks/compose/discover/filesystem.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 88cc08dc23e..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -50,11 +50,6 @@ export async function readOrNull(fs: FileSystem, path: string): Promise>>>>>> 48063902 (Removed comments and modified error handling.) } } From 336a5306bdc60456e8eb9ec066c167170b2ba159 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:33:26 -0700 Subject: [PATCH 076/104] Added test express app --- .../testapps/expressApp/package-lock.json | 604 ++++++++++++++++++ .../discover/testapps/expressApp/package.json | 15 + 2 files changed, 619 insertions(+) create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json new file mode 100644 index 00000000000..36787cbc8cc --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json @@ -0,0 +1,604 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "expressapp", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json new file mode 100644 index 00000000000..4ffc74a94ff --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package.json @@ -0,0 +1,15 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } +} From cb02e7de1f41fce25170f5e92432ba2bb1b37336 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:55:48 -0700 Subject: [PATCH 077/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index b2c7b7f9b47..62a99a4f439 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,6 +15,9 @@ export class LocalFileSystem implements FileSystem { async exists(file: string): Promise { try { + console.log("+++++++PPPPP+++++++++"); + console.log(path.resolve(this.cwd, file)); + console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From caaa7a4bdf53d40a23cc02552a562b61d53011f6 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:09:25 -0700 Subject: [PATCH 078/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 62a99a4f439..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,9 +15,6 @@ export class LocalFileSystem implements FileSystem { async exists(file: string): Promise { try { - console.log("+++++++PPPPP+++++++++"); - console.log(path.resolve(this.cwd, file)); - console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From b9863de1d540549624170334823980025f5da1fa Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:03:50 -0700 Subject: [PATCH 079/104] Changes to filesystem.spec.ts --- output.txt | 4156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4156 insertions(+) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 00000000000..11295634134 --- /dev/null +++ b/output.txt @@ -0,0 +1,4156 @@ + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (251ms) + ✔ should throw when rewrite points to function being deleted (87ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8552ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (74ms) + #url + ✔ should craft URL from host and port in registry (74ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (151ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (73ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + 2) should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 4) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (246ms) + ✔ should throw when executable not found (249ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (107ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (23s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) RepositoryFileSystem + read + should read and return the contents of the file: + + AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } + + expected - actual + + "description": "" + "keywords": [] + "license": "ISC" + "main": "index.js" + - "name": "expressapp" + + "name": "expressApp" + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } + "version": "1.0.0" + + at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 4) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.51 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From e2667bf609d208b34c35e094bc18dc9d7d8cb046 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 11:01:51 -0700 Subject: [PATCH 080/104] Added code to test if correct frameworkSpec is recognized --- output.txt | 74571 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74571 insertions(+) diff --git a/output.txt b/output.txt index 11295634134..29199f81741 100644 --- a/output.txt +++ b/output.txt @@ -4154,3 +4154,74574 @@ All files | 55.8 | 43.51 | 51.57 | 55.91 task-error.ts | 100 | 100 | 100 | 100 | timeout-error.ts | 100 | 100 | 100 | 100 | ---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (286ms) + ✔ should throw when rewrite points to function being deleted (123ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (84ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9113ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (115ms) + ✔ once stopped, an emulator is no longer running (476ms) + #url + ✔ should craft URL from host and port in registry (175ms) + ✔ should quote IPv6 addresses (134ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) + ✔ should use ::1 instead of :: (147ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (75ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 3) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (253ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (256ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (25s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 3) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.52 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (98ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9259ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (95ms) + ✔ once stopped, an emulator is no longer running (76ms) + #url + ✔ should craft URL from host and port in registry (79ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (154ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (267ms) + ✔ should throw when npm root not found (261ms) + ✔ should throw when executable not found (276ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (120ms) + ✔ creates a new typescript codebase with the correct configuration (117ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.53 | 51.53 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (102ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9239ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (107ms) + ✔ once stopped, an emulator is no longer running (83ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (164ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++PPPPPP+++++++++++ +[ true, true ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++PPPPPP+++++++++++ +[ false ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (259ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (265ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (220ms) + ✔ should throw when rewrite points to function being deleted (130ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9155ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (132ms) + ✔ once stopped, an emulator is no longer running (181ms) + #url + 2) should craft URL from host and port in registry + 3) should quote IPv6 addresses + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (148ms) + ✔ should use protocol from request if available (80ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++PPPP+++++++++ + 4) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [], + requiredFiles: [ [Array] ] + } +] +++++++++PPPP+++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (250ms) + ✔ should throw when executable not found (247ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (114ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (27s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should craft URL from host and port in registry: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) EmulatorRegistry + #url + should quote IPv6 addresses: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 4) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.54 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (362ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + 2) updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (88ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8595ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (158ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (254ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (252ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (124ms) + ✔ creates a new typescript codebase with the correct configuration (119ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (105ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (23s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: tenant management + updateTenants + updates tenant config: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.52 | 51.61 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (134ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (82ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9209ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (579ms) + ✔ once stopped, an emulator is no longer running (592ms) + #url + ✔ should craft URL from host and port in registry (458ms) + ✔ should quote IPv6 addresses (169ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) + ✔ should use ::1 instead of :: (741ms) + ✔ should use protocol from request if available (371ms) + ✔ should use host from request if available (101ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (257ms) + ✔ should throw when npm root not found (253ms) + ✔ should throw when executable not found (257ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (113ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (168ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (75ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8982ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (685ms) + ✔ once stopped, an emulator is no longer running (329ms) + #url + ✔ should craft URL from host and port in registry (89ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (152ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (124ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (248ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (223ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (87ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8904ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (101ms) + ✔ once stopped, an emulator is no longer running (82ms) + #url + ✔ should craft URL from host and port in registry (83ms) + ✔ should quote IPv6 addresses (85ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (258ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (127ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (77ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (112ms) + ✔ should throw when rewrite points to function being deleted (64ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8833ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (97ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (78ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (664ms) + ✔ should throw when npm root not found (321ms) + ✔ should throw when executable not found (336ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (49ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (256ms) + ✔ should throw when rewrite points to function being deleted (76ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8626ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (91ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (121ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (260ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (253ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (116ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (149ms) + ✔ should throw when rewrite points to function being deleted (63ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (90ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8882ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (86ms) + ✔ should quote IPv6 addresses (84ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (168ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (263ms) + ✔ should throw when npm root not found (255ms) + ✔ should throw when executable not found (263ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (122ms) + ✔ creates a new typescript codebase with the correct configuration (114ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (80ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled (38ms) + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (115ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9556ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (102ms) + ✔ once stopped, an emulator is no longer running (90ms) + #url + ✔ should craft URL from host and port in registry (84ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (165ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (81ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (517ms) + ✔ should throw when npm root not found (796ms) + ✔ should throw when executable not found (1834ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (121ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.85 | 43.53 | 51.61 | 55.96 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (129ms) + ✔ should throw when rewrite points to function being deleted (54ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + 2) should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (101ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10908ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (109ms) + ✔ once stopped, an emulator is no longer running (93ms) + #url + ✔ should craft URL from host and port in registry (92ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) + ✔ should use ::1 instead of :: (169ms) + ✔ should use protocol from request if available (85ms) + ✔ should use host from request if available (87ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (291ms) + ✔ should throw when npm root not found (364ms) + ✔ should throw when executable not found (769ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (131ms) + ✔ creates a new typescript codebase with the correct configuration (121ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (29s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: accounts:createAuthUri + should find user by either IDP email or 'top-level' email: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response (78ms) + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (302ms) + ✔ should throw when rewrite points to function being deleted (40ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (89ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10281ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (91ms) + ✔ once stopped, an emulator is no longer running (92ms) + #url + ✔ should craft URL from host and port in registry (91ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) + ✔ should use ::1 instead of :: (170ms) + ✔ should use protocol from request if available (92ms) + ✔ should use host from request if available (113ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (288ms) + ✔ should throw when npm root not found (280ms) + ✔ should throw when executable not found (288ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (142ms) + ✔ creates a new typescript codebase with the correct configuration (146ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (100ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (27s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8615ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (256ms) + ✔ once stopped, an emulator is no longer running (957ms) + #url + ✔ should craft URL from host and port in registry (893ms) + ✔ should quote IPv6 addresses (432ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (249ms) + ✔ should use protocol from request if available (102ms) + 2) should use host from request if available + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (139ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (255ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (105ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (26s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should use host from request if available: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (113ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8835ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (94ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (77ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (159ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (265ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (272ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (96ms) + ✔ should throw when rewrite points to function being deleted (59ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled (47ms) + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8923ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (80ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) + ✔ should use ::1 instead of :: (157ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] ++++++++EXPECT+++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} ++++++++ACTUAL+++++++ +Promise { } ++++++END+++++++ + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (260ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (104ms) + ✔ should throw when rewrite points to function being deleted (52ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (74ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8598ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (92ms) + ✔ once stopped, an emulator is no longer running (78ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + ✔ should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (258ms) + ✔ should throw when executable not found (250ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (113ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2542 passing (22s) + 4 pending + 1 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From 555caf09b9afc80b52d1b4389340ca0bd6b450bd Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:00:31 -0700 Subject: [PATCH 081/104] Created node runtime to analyse framework --- output.txt | 78727 --------------------------------------------------- 1 file changed, 78727 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index 29199f81741..00000000000 --- a/output.txt +++ /dev/null @@ -1,78727 +0,0 @@ - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (251ms) - ✔ should throw when rewrite points to function being deleted (87ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8552ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (74ms) - #url - ✔ should craft URL from host and port in registry (74ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (151ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (73ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - 2) should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 4) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (246ms) - ✔ should throw when executable not found (249ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (107ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (23s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) RepositoryFileSystem - read - should read and return the contents of the file: - - AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } - + expected - actual - - "description": "" - "keywords": [] - "license": "ISC" - "main": "index.js" - - "name": "expressapp" - + "name": "expressApp" - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - } - "version": "1.0.0" - - at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 4) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.51 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (286ms) - ✔ should throw when rewrite points to function being deleted (123ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (84ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9113ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (115ms) - ✔ once stopped, an emulator is no longer running (476ms) - #url - ✔ should craft URL from host and port in registry (175ms) - ✔ should quote IPv6 addresses (134ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) - ✔ should use ::1 instead of :: (147ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (75ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 3) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (253ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (256ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (25s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 3) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.52 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (98ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9259ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (95ms) - ✔ once stopped, an emulator is no longer running (76ms) - #url - ✔ should craft URL from host and port in registry (79ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (154ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (267ms) - ✔ should throw when npm root not found (261ms) - ✔ should throw when executable not found (276ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (120ms) - ✔ creates a new typescript codebase with the correct configuration (117ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.53 | 51.53 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (102ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9239ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (107ms) - ✔ once stopped, an emulator is no longer running (83ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (164ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++PPPPPP+++++++++++ -[ true, true ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++PPPPPP+++++++++++ -[ false ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (259ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (265ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (220ms) - ✔ should throw when rewrite points to function being deleted (130ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9155ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (132ms) - ✔ once stopped, an emulator is no longer running (181ms) - #url - 2) should craft URL from host and port in registry - 3) should quote IPv6 addresses - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (148ms) - ✔ should use protocol from request if available (80ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++PPPP+++++++++ - 4) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [], - requiredFiles: [ [Array] ] - } -] -++++++++PPPP+++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (250ms) - ✔ should throw when executable not found (247ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (114ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (27s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should craft URL from host and port in registry: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) EmulatorRegistry - #url - should quote IPv6 addresses: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 4) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.54 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (362ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - 2) updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (88ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8595ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (158ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (254ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (252ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (124ms) - ✔ creates a new typescript codebase with the correct configuration (119ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (105ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (23s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: tenant management - updateTenants - updates tenant config: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.52 | 51.61 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (134ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (82ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9209ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (579ms) - ✔ once stopped, an emulator is no longer running (592ms) - #url - ✔ should craft URL from host and port in registry (458ms) - ✔ should quote IPv6 addresses (169ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) - ✔ should use ::1 instead of :: (741ms) - ✔ should use protocol from request if available (371ms) - ✔ should use host from request if available (101ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (257ms) - ✔ should throw when npm root not found (253ms) - ✔ should throw when executable not found (257ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (113ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (168ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (75ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8982ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (685ms) - ✔ once stopped, an emulator is no longer running (329ms) - #url - ✔ should craft URL from host and port in registry (89ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (152ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (124ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (248ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (223ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (87ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8904ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (101ms) - ✔ once stopped, an emulator is no longer running (82ms) - #url - ✔ should craft URL from host and port in registry (83ms) - ✔ should quote IPv6 addresses (85ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (258ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (127ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (77ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (112ms) - ✔ should throw when rewrite points to function being deleted (64ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8833ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (97ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (78ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (664ms) - ✔ should throw when npm root not found (321ms) - ✔ should throw when executable not found (336ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (49ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (256ms) - ✔ should throw when rewrite points to function being deleted (76ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8626ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (91ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (121ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (260ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (253ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (116ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (149ms) - ✔ should throw when rewrite points to function being deleted (63ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (90ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8882ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (86ms) - ✔ should quote IPv6 addresses (84ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (168ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (263ms) - ✔ should throw when npm root not found (255ms) - ✔ should throw when executable not found (263ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (122ms) - ✔ creates a new typescript codebase with the correct configuration (114ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (80ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled (38ms) - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (115ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9556ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (102ms) - ✔ once stopped, an emulator is no longer running (90ms) - #url - ✔ should craft URL from host and port in registry (84ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (165ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (81ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (517ms) - ✔ should throw when npm root not found (796ms) - ✔ should throw when executable not found (1834ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (121ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.85 | 43.53 | 51.61 | 55.96 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (129ms) - ✔ should throw when rewrite points to function being deleted (54ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - 2) should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (101ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10908ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (109ms) - ✔ once stopped, an emulator is no longer running (93ms) - #url - ✔ should craft URL from host and port in registry (92ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) - ✔ should use ::1 instead of :: (169ms) - ✔ should use protocol from request if available (85ms) - ✔ should use host from request if available (87ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (291ms) - ✔ should throw when npm root not found (364ms) - ✔ should throw when executable not found (769ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (131ms) - ✔ creates a new typescript codebase with the correct configuration (121ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (29s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: accounts:createAuthUri - should find user by either IDP email or 'top-level' email: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response (78ms) - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (302ms) - ✔ should throw when rewrite points to function being deleted (40ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (89ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10281ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (91ms) - ✔ once stopped, an emulator is no longer running (92ms) - #url - ✔ should craft URL from host and port in registry (91ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) - ✔ should use ::1 instead of :: (170ms) - ✔ should use protocol from request if available (92ms) - ✔ should use host from request if available (113ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (288ms) - ✔ should throw when npm root not found (280ms) - ✔ should throw when executable not found (288ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (142ms) - ✔ creates a new typescript codebase with the correct configuration (146ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (100ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (27s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8615ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (256ms) - ✔ once stopped, an emulator is no longer running (957ms) - #url - ✔ should craft URL from host and port in registry (893ms) - ✔ should quote IPv6 addresses (432ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (249ms) - ✔ should use protocol from request if available (102ms) - 2) should use host from request if available - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (139ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (255ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (105ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (26s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should use host from request if available: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (113ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8835ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (94ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (77ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (159ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (265ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (272ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (96ms) - ✔ should throw when rewrite points to function being deleted (59ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled (47ms) - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8923ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (80ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) - ✔ should use ::1 instead of :: (157ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -+++++++EXPECT+++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} -+++++++ACTUAL+++++++ -Promise { } -+++++END+++++++ - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (260ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (104ms) - ✔ should throw when rewrite points to function being deleted (52ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (74ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8598ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (92ms) - ✔ once stopped, an emulator is no longer running (78ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - ✔ should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (258ms) - ✔ should throw when executable not found (250ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (113ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2542 passing (22s) - 4 pending - 1 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- From 43c1ad9acb3347d07341a3388fd3177bbf76dc58 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:02:15 -0700 Subject: [PATCH 082/104] Added mockFileSystem for testing --- .../testapps/expressApp/package-lock.json | 604 ------------------ .../discover/testapps/expressApp/package.json | 15 - 2 files changed, 619 deletions(-) delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json deleted file mode 100644 index 36787cbc8cc..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json +++ /dev/null @@ -1,604 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "expressapp", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json deleted file mode 100644 index 4ffc74a94ff..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} From 9cb09531a891c1a1ac9fd28c311609a7c2f6d725 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:38:28 -0700 Subject: [PATCH 083/104] Resolved code comments --- .../compose/discover/frameworkMatcher.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index ffe203efa4c..b84c48c991d 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -2,9 +2,6 @@ import { FirebaseError } from "../../../error"; import { FrameworkSpec, FileSystem } from "./types"; import { logger } from "../../../logger"; -/** - * - */ export function filterFrameworksWithDependencies( allFrameworkSpecs: FrameworkSpec[], dependencies: Record @@ -16,9 +13,6 @@ export function filterFrameworksWithDependencies( }); } -/** - * - */ export async function filterFrameworksWithFiles( allFrameworkSpecs: FrameworkSpec[], fs: FileSystem @@ -95,6 +89,7 @@ export async function frameworkMatcher( } if (allMatches.length > 1) { const frameworkNames = allMatches.map((framework) => framework.id); +<<<<<<< HEAD throw new FirebaseError( `Multiple Frameworks are matched: ${frameworkNames.join( ", " @@ -105,5 +100,13 @@ export async function frameworkMatcher( return allMatches[0]; } catch (error: any) { throw new FirebaseError(`Failed to match the correct framework: ${error}`); +======= + throw new FirebaseError(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); + } + + return allMatches[0]; + } catch (error) { + throw new FirebaseError("Failed to match the correct frameworkSpec"); +>>>>>>> 25fc256f (Resolved code comments) } } From c9e9ab15227a6d2947d58ec09944cb6cf9570109 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 15:58:13 -0700 Subject: [PATCH 084/104] Removed lint errors --- src/frameworks/compose/discover/frameworkMatcher.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/frameworks/compose/discover/frameworkMatcher.ts b/src/frameworks/compose/discover/frameworkMatcher.ts index b84c48c991d..53748e983c4 100644 --- a/src/frameworks/compose/discover/frameworkMatcher.ts +++ b/src/frameworks/compose/discover/frameworkMatcher.ts @@ -89,7 +89,6 @@ export async function frameworkMatcher( } if (allMatches.length > 1) { const frameworkNames = allMatches.map((framework) => framework.id); -<<<<<<< HEAD throw new FirebaseError( `Multiple Frameworks are matched: ${frameworkNames.join( ", " @@ -100,13 +99,5 @@ export async function frameworkMatcher( return allMatches[0]; } catch (error: any) { throw new FirebaseError(`Failed to match the correct framework: ${error}`); -======= - throw new FirebaseError(`Multiple Frameworks are matched: ${frameworkNames.join(", ")}`); - } - - return allMatches[0]; - } catch (error) { - throw new FirebaseError("Failed to match the correct frameworkSpec"); ->>>>>>> 25fc256f (Resolved code comments) } } From f26e8598484dad6db4ba0ece6e48f9fe86442578 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 085/104] Added code for Node runtime --- src/frameworks/compose/discover/runtime/node.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 8c22188cce6..d4a4aba271c 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,7 +32,6 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); - return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -73,7 +72,6 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } - return NPM; } @@ -165,7 +163,6 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } - return command; } From 63e6477fe992fa08d219a1d03920e85eeec8b3b1 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 086/104] Tests for runtime functionality --- src/frameworks/compose/discover/runtime/node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index d4a4aba271c..67c8cb2d689 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -163,6 +163,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } From 6d11771878b930ebbd1b74e14047d0433107786d Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 087/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 67c8cb2d689..8c22188cce6 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -72,6 +73,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; } From b8308bf06dbb0c5a25671dec0930e67a937bcd98 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 13:25:17 -0700 Subject: [PATCH 088/104] Error handling --- .../compose/discover/runtime/node.ts | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 8c22188cce6..a6d686b014e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -41,32 +41,27 @@ export class NodejsRuntime implements Runtime { } getNodeImage(version: Record | undefined): string { - try { - // If no version is mentioned explicitly, assuming application is compatible with latest version. - if (!version) { - return NODE_LATEST_BASE_IMAGE; - } - const nodeVersion = version.node; - // Splits version number `>=18..0.5` to `>=` and `18.0.5` - const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; - const versionMatch = versionPattern.exec(nodeVersion); - if (!versionMatch) { - return NODE_LATEST_BASE_IMAGE; - } - const operator = versionMatch[1]; - const versionNumber = versionMatch[2]; - const majorVersion = parseInt(versionNumber.split(".")[0]); - if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { - throw new FirebaseError( - "Unsupported node version number, only versions >= 18 are supported." - ); - } - + // If no version is mentioned explicitly, assuming application is compatible with latest version. + if (!version) { return NODE_LATEST_BASE_IMAGE; - } catch (error) { - logger.error("Failed to getNodeVersion", error); - throw error; } + const nodeVersion = version.node; + // Splits version number `>=18..0.5` to `>=` and `18.0.5` + const versionPattern = /^([>=<^~]+)?(\d+\.\d+\.\d+)$/; + const versionMatch = versionPattern.exec(nodeVersion); + if (!versionMatch) { + return NODE_LATEST_BASE_IMAGE; + } + const operator = versionMatch[1]; + const versionNumber = versionMatch[2]; + const majorVersion = parseInt(versionNumber.split(".")[0]); + if ((!operator || operator === "^" || operator === "~") && majorVersion < 18) { + throw new FirebaseError( + "Unsupported node version number, only versions >= 18 are supported." + ); + } + + return NODE_LATEST_BASE_IMAGE; } async getPackageManager(fs: FileSystem): Promise { @@ -114,7 +109,7 @@ export class NodejsRuntime implements Runtime { return dependencies; } catch (error: any) { - logger.error("Failed to getDependencies for the project: ", error); + logger.error("Error while reading dependencies for the project: ", error); throw error; } } @@ -251,8 +246,7 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { - logger.error("Failed to analyseCodebase: ", error); - throw error; + throw new FirebaseError(`Failed to indentify commands for codebase: ${error}`); } } } From a6b39b1a37dee0a2832546145336ce25c4bb4568 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 089/104] Added code for Node runtime --- src/frameworks/compose/discover/runtime/node.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index a6d686b014e..c17758c745e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,7 +32,6 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); - return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -68,7 +67,6 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } - return NPM; } @@ -160,7 +158,6 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } - return command; } From b0e0f9e5bd1e2c0dfbd4d41d11bdd26d7e5fcd9c Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 090/104] Tests for runtime functionality --- src/frameworks/compose/discover/runtime/node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index c17758c745e..2ed5858a833 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -158,6 +158,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } From f1cabdc15a53cbe62bfc8b30b992e74676698a30 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 091/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 2ed5858a833..a6d686b014e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -67,6 +68,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; } From 231716f808b7a1d455d8fad57ac2d1a489358281 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 10:02:25 -0700 Subject: [PATCH 092/104] Error handling corrections --- src/frameworks/compose/discover/runtime/node.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index a6d686b014e..29051e43d1b 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -246,7 +246,12 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { +<<<<<<< HEAD throw new FirebaseError(`Failed to indentify commands for codebase: ${error}`); +======= + logger.error("Failed to analyseCodebase: ", error); + throw error; +>>>>>>> 822fc93b (Error handling corrections) } } } From f2c9aa392618e51d9059dfe2b7291d3c5a380871 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 17:28:37 -0700 Subject: [PATCH 093/104] Removed comments and modified error handling. --- src/frameworks/compose/discover/filesystem.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index b2c7b7f9b47..88cc08dc23e 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -50,6 +50,11 @@ export async function readOrNull(fs: FileSystem, path: string): Promise>>>>>> 48063902 (Removed comments and modified error handling.) } } From 2af246cfe52aca4a929f6579155a521d63ed507a Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 18:00:25 -0700 Subject: [PATCH 094/104] Resolved indentation issues --- src/frameworks/compose/discover/filesystem.ts | 5 ----- src/frameworks/compose/discover/runtime/node.ts | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 88cc08dc23e..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -50,11 +50,6 @@ export async function readOrNull(fs: FileSystem, path: string): Promise>>>>>> 48063902 (Removed comments and modified error handling.) } } diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 29051e43d1b..a6d686b014e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -246,12 +246,7 @@ export class NodejsRuntime implements Runtime { return runtimeSpec; } catch (error: any) { -<<<<<<< HEAD throw new FirebaseError(`Failed to indentify commands for codebase: ${error}`); -======= - logger.error("Failed to analyseCodebase: ", error); - throw error; ->>>>>>> 822fc93b (Error handling corrections) } } } From 5e21afcd818f0c7844fec414b82959e0a181a295 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:33:26 -0700 Subject: [PATCH 095/104] Added test express app --- .../testapps/expressApp/package-lock.json | 604 ++++++++++++++++++ .../discover/testapps/expressApp/package.json | 15 + 2 files changed, 619 insertions(+) create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json create mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json new file mode 100644 index 00000000000..36787cbc8cc --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json @@ -0,0 +1,604 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "expressapp", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json new file mode 100644 index 00000000000..4ffc74a94ff --- /dev/null +++ b/src/frameworks/compose/discover/testapps/expressApp/package.json @@ -0,0 +1,15 @@ +{ + "name": "expressapp", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.18.2" + } +} From 55b073f6eda9bd605503e49824dc1d4261ae2126 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 20:55:48 -0700 Subject: [PATCH 096/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index b2c7b7f9b47..62a99a4f439 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,6 +15,9 @@ export class LocalFileSystem implements FileSystem { async exists(file: string): Promise { try { + console.log("+++++++PPPPP+++++++++"); + console.log(path.resolve(this.cwd, file)); + console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From bc3bae423c09746426342ca8f30b0674a6eb8bce Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Thu, 8 Jun 2023 21:09:25 -0700 Subject: [PATCH 097/104] Update filesystem.ts --- src/frameworks/compose/discover/filesystem.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/filesystem.ts b/src/frameworks/compose/discover/filesystem.ts index 62a99a4f439..b2c7b7f9b47 100644 --- a/src/frameworks/compose/discover/filesystem.ts +++ b/src/frameworks/compose/discover/filesystem.ts @@ -15,9 +15,6 @@ export class LocalFileSystem implements FileSystem { async exists(file: string): Promise { try { - console.log("+++++++PPPPP+++++++++"); - console.log(path.resolve(this.cwd, file)); - console.log("+++++++PPPPP+++++++++"); if (!(file in this.contentCache)) { this.existsCache[file] = await pathExists(path.resolve(this.cwd, file)); } From 07cc9c60df6160244e3cbaeaabb09e4001b17ce4 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 07:03:50 -0700 Subject: [PATCH 098/104] Changes to filesystem.spec.ts --- output.txt | 4156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4156 insertions(+) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 00000000000..11295634134 --- /dev/null +++ b/output.txt @@ -0,0 +1,4156 @@ + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (251ms) + ✔ should throw when rewrite points to function being deleted (87ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8552ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (74ms) + #url + ✔ should craft URL from host and port in registry (74ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (151ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (73ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + 2) should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 4) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (246ms) + ✔ should throw when executable not found (249ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (107ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (23s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) RepositoryFileSystem + read + should read and return the contents of the file: + + AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } + + expected - actual + + "description": "" + "keywords": [] + "license": "ISC" + "main": "index.js" + - "name": "expressapp" + + "name": "expressApp" + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } + "version": "1.0.0" + + at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 4) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.51 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From 3f37849fff9dce21de518b891e417d3f15729d92 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 11:01:51 -0700 Subject: [PATCH 099/104] Added code to test if correct frameworkSpec is recognized --- output.txt | 74571 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74571 insertions(+) diff --git a/output.txt b/output.txt index 11295634134..29199f81741 100644 --- a/output.txt +++ b/output.txt @@ -4154,3 +4154,74574 @@ All files | 55.8 | 43.51 | 51.57 | 55.91 task-error.ts | 100 | 100 | 100 | 100 | timeout-error.ts | 100 | 100 | 100 | 100 | ---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (286ms) + ✔ should throw when rewrite points to function being deleted (123ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (84ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9113ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (115ms) + ✔ once stopped, an emulator is no longer running (476ms) + #url + ✔ should craft URL from host and port in registry (175ms) + ✔ should quote IPv6 addresses (134ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) + ✔ should use ::1 instead of :: (147ms) + ✔ should use protocol from request if available (73ms) + ✔ should use host from request if available (75ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + 3) should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (253ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (256ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (25s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + + AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } + + expected - actual + + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + 3) frameworkMatcher + filterFrameworksWithFiles + should return frameworks having all the required files: + + AssertionError: expected [] to have the same members as [ Array(1) ] + + expected - actual + + -[] + +[ + + { + + "id": "express" + + "requiredDependencies": [] + + "requiredFiles": [ + + "package.json" + + "package-lock.json" + + ] + + "runtime": "nodejs" + + } + +] + + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.8 | 43.52 | 51.57 | 55.91 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (98ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9259ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (95ms) + ✔ once stopped, an emulator is no longer running (76ms) + #url + ✔ should craft URL from host and port in registry (79ms) + ✔ should quote IPv6 addresses (74ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (154ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (267ms) + ✔ should throw when npm root not found (261ms) + ✔ should throw when executable not found (276ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (120ms) + ✔ creates a new typescript codebase with the correct configuration (117ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.53 | 51.53 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (102ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9239ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (107ms) + ✔ once stopped, an emulator is no longer running (83ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (164ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++++PPPPPP+++++++++++ +[ true, true ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +true +++++++++++BBBB+++++++++++ +++++++++++PPPPPP+++++++++++ +[ false ] +++++++++++PPPPPP+++++++++++ +++++++++++BBBBB+++++++++++ +false +++++++++++BBBB+++++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (259ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (265ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (220ms) + ✔ should throw when rewrite points to function being deleted (130ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9155ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (132ms) + ✔ once stopped, an emulator is no longer running (181ms) + #url + 2) should craft URL from host and port in registry + 3) should quote IPv6 addresses + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (148ms) + ✔ should use protocol from request if available (80ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++PPPP+++++++++ + 4) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles +++++++++PPPP+++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [], + requiredFiles: [ [Array] ] + } +] +++++++++PPPP+++++++++ + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (250ms) + ✔ should throw when executable not found (247ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (114ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2539 passing (27s) + 4 pending + 4 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should craft URL from host and port in registry: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) EmulatorRegistry + #url + should quote IPv6 addresses: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 4) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.54 | 51.58 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (362ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + 2) updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (88ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8595ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (158ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (79ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 3) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (254ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (252ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (124ms) + ✔ creates a new typescript codebase with the correct configuration (119ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) + ✔ should reject with TimeoutError if timeout while retrying (105ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (23s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: tenant management + updateTenants + updates tenant config: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.81 | 43.52 | 51.61 | 55.92 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (134ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (82ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9209ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (579ms) + ✔ once stopped, an emulator is no longer running (592ms) + #url + ✔ should craft URL from host and port in registry (458ms) + ✔ should quote IPv6 addresses (169ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) + ✔ should use ::1 instead of :: (741ms) + ✔ should use protocol from request if available (371ms) + ✔ should use host from request if available (101ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + 2) should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (257ms) + ✔ should throw when npm root not found (253ms) + ✔ should throw when executable not found (257ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (113ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (101ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (168ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (75ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8982ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (685ms) + ✔ once stopped, an emulator is no longer running (329ms) + #url + ✔ should craft URL from host and port in registry (89ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) + ✔ should use ::1 instead of :: (152ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (124ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (251ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (248ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (108ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (223ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (87ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8904ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (101ms) + ✔ once stopped, an emulator is no longer running (82ms) + #url + ✔ should craft URL from host and port in registry (83ms) + ✔ should quote IPv6 addresses (85ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (258ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (127ms) + ✔ creates a new typescript codebase with the correct configuration (109ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (77ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (112ms) + ✔ should throw when rewrite points to function being deleted (64ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8833ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (97ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (78ms) + ✔ should quote IPv6 addresses (78ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (664ms) + ✔ should throw when npm root not found (321ms) + ✔ should throw when executable not found (336ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.83 | 43.52 | 51.62 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (49ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (256ms) + ✔ should throw when rewrite points to function being deleted (76ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8626ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (76ms) + ✔ should quote IPv6 addresses (91ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) + ✔ should use ::1 instead of :: (155ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (121ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (260ms) + ✔ should throw when npm root not found (244ms) + ✔ should throw when executable not found (253ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (116ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (73ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (104ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (149ms) + ✔ should throw when rewrite points to function being deleted (63ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (90ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8882ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (90ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (86ms) + ✔ should quote IPv6 addresses (84ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (168ms) + ✔ should use protocol from request if available (78ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (263ms) + ✔ should throw when npm root not found (255ms) + ✔ should throw when executable not found (263ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (122ms) + ✔ creates a new typescript codebase with the correct configuration (114ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (80ms) + ✔ should reject with TimeoutError when timed out after failed retries (204ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled (38ms) + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (24s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (115ms) + ✔ should throw when rewrite points to function being deleted (55ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (77ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (9556ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (102ms) + ✔ once stopped, an emulator is no longer running (90ms) + #url + ✔ should craft URL from host and port in registry (84ms) + ✔ should quote IPv6 addresses (79ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) + ✔ should use ::1 instead of :: (165ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (81ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ +++++++DEP++++++++ +[Function: filterFrameworksWithDependencies] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[AsyncFunction: filterFrameworksWithFiles] +++++++EMB++++++++ +[Function: removeEmbededFrameworks] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +express +true +{ express: '^4.18.2' } ++++++++++++SSS++++++++ ++++++++++++DDDDD++++++++ ++++++++++++SSS++++++++ +next +false +{ express: '^4.18.2' } ++++++++++++SSS++++++++ +++++++++RES+++++ +[ + { + id: 'express', + runtime: 'nodejs', + requiredDependencies: [ [Object] ] + } +] +++++++++RES+++++ + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (517ms) + ✔ should throw when npm root not found (796ms) + ✔ should throw when executable not found (1834ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (121ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (73ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (26s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.85 | 43.53 | 51.61 | 55.96 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (129ms) + ✔ should throw when rewrite points to function being deleted (54ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + 2) should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (101ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10908ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (109ms) + ✔ once stopped, an emulator is no longer running (93ms) + #url + ✔ should craft URL from host and port in registry (92ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) + ✔ should use ::1 instead of :: (169ms) + ✔ should use protocol from request if available (85ms) + ✔ should use host from request if available (87ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (291ms) + ✔ should throw when npm root not found (364ms) + ✔ should throw when executable not found (769ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (131ms) + ✔ creates a new typescript codebase with the correct configuration (121ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (203ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (103ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (29s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) Auth Emulator: accounts:createAuthUri + should find user by either IDP email or 'top-level' email: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response (78ms) + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (302ms) + ✔ should throw when rewrite points to function being deleted (40ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (89ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (10281ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (91ms) + ✔ once stopped, an emulator is no longer running (92ms) + #url + ✔ should craft URL from host and port in registry (91ms) + ✔ should quote IPv6 addresses (90ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) + ✔ should use ::1 instead of :: (170ms) + ✔ should use protocol from request if available (92ms) + ✔ should use host from request if available (113ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (117ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (288ms) + ✔ should throw when npm root not found (280ms) + ✔ should throw when executable not found (288ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (142ms) + ✔ creates a new typescript codebase with the correct configuration (146ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (72ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (100ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (27s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.53 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (126ms) + ✔ should throw when rewrite points to function being deleted (56ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (78ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8615ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (256ms) + ✔ once stopped, an emulator is no longer running (957ms) + #url + ✔ should craft URL from host and port in registry (893ms) + ✔ should quote IPv6 addresses (432ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) + ✔ should use ::1 instead of :: (249ms) + ✔ should use protocol from request if available (102ms) + 2) should use host from request if available + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (139ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 3) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (245ms) + ✔ should throw when executable not found (255ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (119ms) + ✔ creates a new typescript codebase with the correct configuration (105ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (70ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (102ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2540 passing (26s) + 4 pending + 3 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) EmulatorRegistry + #url + should use host from request if available: + Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) + at listOnTimeout (node:internal/timers:573:17) + at processTimers (node:internal/timers:514:7) + + 3) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (51ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (113ms) + ✔ should throw when rewrite points to function being deleted + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8835ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (94ms) + ✔ once stopped, an emulator is no longer running (79ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (77ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) + ✔ should use ::1 instead of :: (159ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (80ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (115ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (265ms) + ✔ should throw when npm root not found (249ms) + ✔ should throw when executable not found (272ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (123ms) + ✔ creates a new typescript codebase with the correct configuration (110ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (71ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (22s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (52ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (96ms) + ✔ should throw when rewrite points to function being deleted (59ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled (47ms) + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (76ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8923ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (93ms) + ✔ once stopped, an emulator is no longer running (80ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (80ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) + ✔ should use ::1 instead of :: (157ms) + ✔ should use protocol from request if available (76ms) + ✔ should use host from request if available (78ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (123ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher +++++++START++++++++ +++++++RUN++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + }, + { + id: 'nextjs', + runtime: 'nodejs', + webFrameworkId: 'Next.js', + requiredFiles: [ 'next.config.js', 'next.config.ts' ], + requiredDependencies: [ [Object] ], + commands: { build: [Object], dev: [Object], run: [Object] } + } +] +++++++DEP++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] ++++++++EXPECT+++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} ++++++++ACTUAL+++++++ +Promise { } ++++++END+++++++ + 2) should return express FrameworkSpec after analysing express application +++++++FIL++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +1 +++++++EMB222++++++++ +[ + { + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ [Object] ] + } +] +++++++EMB333++++++++ +{ + id: 'express', + runtime: 'nodejs', + webFrameworkId: 'Express.js', + requiredDependencies: [ { name: 'express' } ] +} + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (252ms) + ✔ should throw when npm root not found (256ms) + ✔ should throw when executable not found (260ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (117ms) + ✔ creates a new typescript codebase with the correct configuration (112ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (71ms) + ✔ should reject with TimeoutError when timed out after failed retries (201ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) + ✔ should reject with TimeoutError if timeout while retrying (102ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2541 passing (23s) + 4 pending + 2 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + 2) frameworkMatcher + frameworkMatcher + should return express FrameworkSpec after analysing express application: + AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } + at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) + at processImmediate (node:internal/timers:478:21) + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.84 | 43.52 | 51.61 | 55.94 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- + +> firebase-tools@12.3.1 mocha +> nyc mocha 'src/test/**/*.{ts,js}' + + + + accountExporter + validateOptions + ✔ should reject when no format provided + ✔ should reject when format is not csv or json + ✔ should ignore format param when implicitly specified in file name + ✔ should use format param when not implicitly specified in file name + serialExportUsers + ✔ should call api.request multiple times for JSON export + ✔ should call api.request multiple times for CSV export + ✔ should encapsulate displayNames with commas for csv formats + ✔ should not emit redundant comma in JSON on consecutive calls + ✔ should export a user's custom attributes for JSON formats + ✔ should export a user's custom attributes for CSV formats + + accountImporter + transArrayToUser + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + validateOptions + ✔ should reject when unsupported hash algorithm provided + ✔ should reject when missing parameters + validateUserJson + ✔ should reject when unknown fields in user json + ✔ should reject when unknown fields in providerUserInfo of user json + ✔ should reject when unknown providerUserInfo of user json + ✔ should reject when passwordHash is invalid base64 + ✔ should not reject when passwordHash is valid base64 + serialImportUsers + ✔ should call api.request multiple times + ✔ should continue when some request's response is 200 but has `error` in response + + api + ✔ should override with FIRESTORE_URL + ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL + + apiv2 + request + ✔ should throw on a basic 404 GET request + ✔ should be able to resolve on a 404 GET request + ✔ should make a basic GET request + ✔ should be able to handle specified retry codes + ✔ should return an error if the retry never succeeds + ✔ should be able to resolve the error response if retry codes never succeed + ✔ should not allow resolving on http error when streaming + ✔ should be able to stream a GET request + ✔ should set a bearer token to 'owner' if making an insecure, local request + 1) should error with a FirebaseError if JSON is malformed + ✔ should error with a FirebaseError if an error happens + ✔ should error with a FirebaseError if an invalid responseType is provided + ✔ should resolve a 400 GET request + ✔ should resolve a 404 GET request + ✔ should be able to resolve a stream on a 404 GET request + ✔ should make a basic GET request if path didn't include a leading slash + ✔ should make a basic GET request if urlPrefix did have a trailing slash + ✔ should make a basic GET request with an api version + ✔ should make a basic GET request with a query string + ✔ should make a basic GET request and not override the user-agent + ✔ should handle a 204 response with no data + ✔ should be able to time out if the request takes too long + ✔ should be able to be killed by a signal + ✔ should make a basic POST request + ✔ should make a basic POST request without overriding Content-Type + ✔ should make a basic POST request with a stream + ✔ should preserve XML messages + ✔ should preserve XML messages on error + with a proxy + ✔ should be able to make a basic GET request + verbs + ✔ should make a GET request + ✔ should make a POST request + ✔ should make a PUT request + ✔ should make a PATCH request + ✔ should make a DELETE request + + distribution + addTesters + ✔ should throw error if request fails + ✔ should resolve when request succeeds + deleteTesters + ✔ should throw error if delete fails + ✔ should resolve when request succeeds + uploadRelease + ✔ should throw error if upload fails + ✔ should return token if upload succeeds + updateReleaseNotes + ✔ should return immediately when no release notes are specified + ✔ should throw error when request fails + ✔ should resolve when request succeeds + distribute + ✔ should return immediately when testers and groups are empty + ✔ should resolve when request succeeds + when request fails + ✔ should throw invalid testers error when status code is FAILED_PRECONDITION + ✔ should throw invalid groups error when status code is INVALID_ARGUMENT + ✔ should throw default error + + archiveDirectory + ✔ should archive happy little directories + ✔ should throw a happy little error if the directory doesn't exist + + auth + no accounts + ✔ returns no global account when config is empty + single account + ✔ returns global default account + ✔ returns no additional accounts + ✔ returns exactly one total account + multi account + ✔ returns global default account + ✔ returns additional accounts + ✔ returns all accounts + ✔ respects project default when present + ✔ ignores project default when not present + ✔ prefers account flag to project root + + checkMinRequiredVersion + ✔ should error if installed version is below the min required version + ✔ should not error if installed version is above the min required version + + checkValidTargetFilters + ✔ should resolve + ✔ should resolve if there are no 'only' targets specified + ✔ should error if an only option and except option have been provided + ✔ should error if non-filter-type target (remoteconfig) has filters + ✔ should error if non-filter-type target (extensions) has filters + ✔ should error if the same target is specified with and without a filter + + Command + ✔ should allow all basic behavior + runner + ✔ should work when no arguments are passed and options + ✔ should execute befores before the action + ✔ should terminate execution if a before errors + ✔ should reject the promise if an error is thrown + ✔ should resolve a numeric --project flag into a project id + ✔ should resolve a non-numeric --project flag into a project id + + validateProjectId + ✔ should not throw for valid project ids + ✔ should not throw for legacy project ids + ✔ should block invalid project ids + ✔ should error with additional note for uppercase project ids + + Config + #load + ✔ should load a cjson file when configPath is specified + #parseFile + ✔ should load a cjson file + ✔ should error out for an unknown file + ✔ should error out for an unrecognized extension + #materialize + ✔ should assign unaltered if an object is found + ✔ should prevent top-level key duplication + + api + ✔ should add HTTP to emulator URL with no protocol + ✔ should not add HTTP to emulator URL with https:// protocol + ✔ should override with FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL + ✔ should prefer FIREBASE_REALTIME_URL when run without emulator + ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator + + FakeListRemote + ✔ should return limit the number of subpaths returned + + FakeRemoveRemote + ✔ should failed to delete large path / + ✔ should sucessfully delete large path / + ✔ should failed to delete large path /1 + ✔ should successfully delete path /1/a + ✔ should failed to delete large paths /1/a /1/b + ✔ should successfully delete multi paths /1/c /1/d + + DatabaseImporter + ✔ throws FirebaseError when JSON is invalid + ✔ batches data from different top-level objects + ✔ writes data as a single batch for large enough payload size + ✔ imports from data path + ✔ writes primitive as object + ✔ writes array as object + ✔ throws FirebaseError when data location is nonempty + ✔ retries non-fatal connection timeout error + + ListRemote + ✔ should return subpaths from shallow get request + + DatabaseRemove + ✔ should remove tiny tree + ✔ should remove subtree at /a/b/c + DatabaseRemove when largeThreshold=100 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=10 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + DatabaseRemove when largeThreshold=1 + ✔ should remove nested tree + ✔ should remove flat tree when threshold=${threshold} + + RemoveRemote + ✔ should return true when patch is small + ✔ should return false whem patch is large + ✔ should return true when multi-path patch is small + ✔ should return false when multi-path patch is large + ✔ should send disableTriggers param + + defaultCredentials + ✔ creates a credential file when there are tokens in the config + ✔ can clear credentials + ✔ includes the users email in the path + + Extensions Deployment Planner + resolveSemver + ✔ should return the latest version that satisifies a semver range + ✔ should match exact semver + ✔ should resolve latest to a version + ✔ should default to latest-approved version + ✔ should resolve explicit latest-approved + ✔ should error if there is no matching version + have + ✔ have() should return correct instance spec with events + ✔ have() should return correct instance spec with undefined events config + ✔ have() should return correct instance spec with empty events config + + ensureNecessaryV2ApisAndRoles + ✔ should succeed when IAM policy is correct + ✔ should fix the IAM policy by adding missing bindings + + Backend + Helper functions + ✔ isEmptyBackend + ✔ names + ✔ merge + existing backend + existingBackend + ✔ should throw error when functions list fails + ✔ should cache + ✔ should translate functions + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should throw an error if v2 list api throws an error + ✔ should read v1 functions only when user is not allowlisted for v2 + ✔ should read v2 functions when enabled + ✔ should deduce features of scheduled functions + checkAvailability + ✔ should throw error when functions list fails + ✔ should do nothing when regions are all avalable + ✔ should warn if an unused GCFv1 backend is unavailable + ✔ should warn if an unused GCFv2 backend is unavailable + ✔ should throw if a needed GCFv1 region is unavailable + ✔ should throw if a GCFv2 needed region is unavailable + ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. + ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. + compareFunctions + ✔ should compare different platforms + ✔ should compare different regions, same platform + ✔ should compare different ids, same platform & region + ✔ should compare same ids + comprehension helpers + ✔ allEndpoints + ✔ matchingBackend + ✔ someEndpoint + ✔ findEndpoint + ✔ regionalEndpoints + ✔ hasEndpoint + ✔ missingEndpoint + + toBackend + ✔ populates backend info from Build + ✔ doesn't populate if omit is set on the build + ✔ populates multiple specified invokers correctly + + applyHash + applyBackendHashToBackends + ✔ should applyHash to each endpoint of a given backend + + getBackendHash + getEnvironmentVariablesHash + ✔ should return different hash given different env variables + ✔ should return same hash given same env variables + getSecretsHash + ✔ should return different hash given different secret versions + ✔ should return same hash given same secret versions + getSourceHash + ✔ should return different hash given different files + ✔ should return the same hash given the same file + getEndpointHash + ✔ should return different hash given hashes + ✔ should return different hash given partial difference + ✔ should return same hash given same hashes + ✔ should filter out undefined hashes + + CEL evaluation + String list resolution + ✔ can pull lists directly out of paramvalues + ✔ can handle literals in a list + ✔ can handle CEL expressions in a list + ✔ can handle direct references to string params in a list + ✔ can handle a list with multiple elements + ✔ isn't picky about whitespace around the commas + ✔ can do == comparisons between lists + ✔ throws if asked to do type comparisons between lists + Identity expressions + ✔ raises when the referenced parameter does not exist + ✔ raises when the referenced parameter is of the wrong type + ✔ pulls number parameters + Comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Dual comparison expressions + ✔ raises when the LHS param does not exist + ✔ raises when the RHS param does not exist + ✔ raises when a literal is provided as the LHS + ✔ raises when the type of the LHS and RHS do not match + ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == + ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones + Ternary expressions conditioned on an comparison test + ✔ raises when the LHS param does not exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on an comparison test between two params + ✔ raises when one of the params to compare doesn't exist + ✔ raises when the type of the LHS and RHS do not match + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators + Ternary expressions conditioned on a boolean parameter + ✔ raises when the condition param does not exist + ✔ raises when the condition param is not a boolean + ✔ raises when the ternary expression evaluates to something of the wrong type + ✔ raises when the ternary expression evaluates to a missing parameter + ✔ it provides resolved parameters when the ternary expression calls for them + ✔ it provides literal expressions when the ternary expression calls for them + + checkIam + ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions + ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions + ✔ should not add bindings for a new v2 alerts function with v2 deployed functions + ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions + ✔ should not add bindings for a new v2 remote config function with v2 deployed functions + ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions + ✔ should not add bindings for a new v2 test lab function with v2 deployed functions + obtainPubSubServiceAgentBindings + ✔ should obtain the bindings + obtainDefaultComputeServiceAgentBindings + ✔ should obtain the bindings + mergeBindings + ✔ should not update the policy when the bindings are present + ✔ should update the members of a binding in the policy + ✔ should add a new binding to the policy + ensureServiceAgentRoles + ✔ should return early if we do not have new services + ✔ should return early if we fail to get the IAM policy + ✔ should error if we fail to set the IAM policy + ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions + + CleanupBuildImages + ✔ uses GCR and AR + ✔ reports failed domains from AR + ✔ reports failed domains from GCR + + DockerHelper + ✔ Fetches tags with caching + ✔ Deletes recursively + + ArtifactRegistryCleaner + ✔ deletes artifacts + ✔ deletes cache dirs + ✔ bypasses poller if the operation is completed + ✔ encodeds to avoid upper-case letters + + ContainerRegistryCleaner + ✔ Handles cleanup of first function in the region + ✔ Handles cleanup of second function in the region + ✔ Leaves other directories alone + + listGcfPaths + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail search + ✔ should list paths, single location param + ✔ should list paths, multiple locations param + ✔ should list paths, only locations in gcr + ✔ should list paths, all locations + + deleteGcfArtifacts + ✔ should throw an error on invalid location + ✔ should throw an error when subdomains fail deletion + ✔ should delete a location + ✔ should delete multiple locations + ✔ should purge all locations + + deploy + shouldUploadBeSkipped + ✔ should skip if all endpoints are identical + ✔ should not skip if hashes don't match + ✔ should not skip if haveBackend is missing + ✔ should not skip if wantBackend is missing + ✔ should not skip if endpoint filter is specified + + ensureCloudBuildEnabled() + with cloudbuild service enabled + ✔ should succeed + with cloudbuild service disabled, but enabling succeeds + ✔ should succeed + with cloudbuild service disabled, but enabling fails with billing error + ✔ should error + with cloudbuild service disabled, but enabling fails with permission error + ✔ should error + + ensureSecretAccess + ✔ ensures access to default service account + ✔ ensures access to all secrets + ✔ combines service account to make one call per secret + ✔ skips calling IAM if secret is already bound to a service account + ✔ does not include service account already bounud to a secret + + functionsDeployHelper + endpointMatchesFilter + ✔ should match empty filter + ✔ should match full names + ✔ should match group prefixes + ✔ should not match function that id that don't match + ✔ should not match function in different codebase + ✔ should match function if backend's codebase is undefined + ✔ should match function matching ids given no codebase + endpointMatchesAnyFilters + ✔ should match given no filters + ✔ should match against one filter + ✔ should exclude functions that don't match + parseFunctionSelector + ✔ parses selector without codebase + ✔ parses group selector (with '.') without codebase + ✔ parses group selector (with '-') without codebase + ✔ parses group selector (with '-') with codebase + getEndpointFilters + ✔ should parse multiple selectors + ✔ should parse nested selector + ✔ should parse selector with codebase + ✔ should parse nested selector with codebase + ✔ returns undefined given no only option + ✔ returns undefined given no functions selector + targetCodebases + ✔ returns all codebases in firebase.json with empty filters + ✔ returns only codebases included in the filters + ✔ correctly deals with duplicate entries + ✔ returns all codebases given filter without codebase specified + groupEndpointsByCodebase + ✔ groups codebase using codebase property + ✔ claims endpoint with matching name regardless of codebase property + + CEL resolution + ✔ can interpolate a provided param into a CEL expression + ✔ can interpolate multiple params into a CEL expression + ✔ throws instead of coercing a param value with the wrong type + ✔ can't handle non-identity CEL expressions yet + + resolveParams + ✔ always contains the precanned internal param values + ✔ can pull a literal value out of the dotenvs + ✔ params from dotenvs override internal params of the same name + ✔ does not create the corresponding internal params if database url/storage bucket are not configured + ✔ can use a provided literal + ✔ can resolve a CEL identity expression + ✔ can resolve a CEL expression containing only identities + ✔ can resolve a CEL expression depending on the internal params + ✔ errors when the default is an unresolvable CEL expression + ✔ errors when the default is a CEL expression that resolves to the wrong type + + prepare + inferDetailsFromExisting + ✔ merges env vars if .env is not used + ✔ overwrites env vars if .env is used + ✔ can noop when there is no prior endpoint + ✔ can fill in regions from last deploy + ✔ doesn't fill in regions if triggers changed + ✔ fills in instance size + ✔ downgrades concurrency if necessary (explicit) + ✔ downgrades concurrency if necessary (implicit) + ✔ upgrades default concurrency with CPU upgrades + inferBlockingDetails + ✔ should merge the blocking options and set default value + updateEndpointTargetedStatus + ✔ should mark targeted codebases + ✔ should mark targeted codebases + ids + ✔ should mark targeted ids + + prepareFunctionsUpload + convertToSortedKeyValueArray + ✔ should deep sort the resulting array when an input config object is not sorted + ✔ should return null when config input is null + ✔ should return an empty array when config input is an empty object + + Functions Pricing + canCalculateMinInstanceCost + ✔ Can calculate the $0 cost of a function without min instances + ✔ Can calculate the cost of a well formed v1 function + ✔ Can calculate the cost of a well formed v2 function + ✔ Cannot calculate the cost of an unknown instance size + ✔ Cannot calculate the cost for an unknown region + monthlyMinInstanceCost + ✔ can calculate a v1 tier1 bill + ✔ doesn't estimate bills for unreserved instances + ✔ can calculate a bill for a two reserved instances + ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions + ✔ can calculate a v1 tier2 bill + ✔ can calculate a v1 bill for large instances + ✔ can calculate a v2 tier1 bill + ✔ can calculate a v2 tier2 bill + ✔ can calculate a v2 bill for large instances + ✔ calculates v1 and v2 discounts separately + + promptForFailurePolicies + ✔ should prompt if there are new functions with failure policies + ✔ should not prompt if all functions with failure policies already had failure policies + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function adds a failure policy + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with failure policies + ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set + + promptForMinInstances + ✔ should prompt if there are new functions with minInstances + ✔ should not prompt if no fucntion has minInstance + ✔ should not prompt if all functions with minInstances already had the same number of minInstances + ✔ should not prompt if functions decrease in minInstances + ✔ should throw if user declines the prompt + ✔ should prompt if an existing function sets minInstances + ✔ should prompt if an existing function increases minInstances + ✔ should prompt if a minInstance function increases resource reservations + ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt + ✔ should not prompt if there are no functions with minInstances + ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set + ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set + ✔ Should disclaim if a bill cannot be calculated + + Executor + QueueExecutor + ✔ supports arbitrary return types + ✔ throws errors + ✔ retries temporary errors + ✔ eventually gives up on retryable errors + ✔ retries on custom specified retry codes + + Fabricator + ✔ does not delete if there are upsert errors + ✔ applies all kinds of changes + createV1Function + ✔ throws on create function failure + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ sets public invoker by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ always sets invoker to public + taskQueueTrigger + ✔ enforces SECURE_ALWAYS HTTPS policies + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ sets the invoker to public + updateV1Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV1Function + ✔ throws on delete function failure + createV2Function + ✔ handles topics that already exist + ✔ handles failures to create a topic + ✔ handles already existing eventarc channels + ✔ handles already existing eventarc channels (createChannel return 409) + ✔ creates channels if necessary + ✔ wraps errors thrown while creating channels + ✔ throws on create function failure + ✔ deletes broken function and retries on cloud run quota exhaustion + ✔ throws on set invoker failure + ✔ doesn't set invoker on non-http functions + httpsTrigger + ✔ sets invoker to public by default + ✔ sets explicit invoker + ✔ doesn't set private invoker on create + callableTrigger + ✔ always sets invoker to public + taskQueueTrigger + ✔ doesn't set invoker by default + ✔ sets explicit invoker + blockingTrigger + ✔ always sets invoker to public + updateV2Function + ✔ throws on update function failure + ✔ throws on set invoker failure + ✔ sets explicit invoker on httpsTrigger + ✔ sets explicit invoker on taskQueueTrigger + ✔ sets explicit invoker on blockingTrigger + ✔ does not set invoker by default + ✔ doesn't set invoker on non-http functions + deleteV2Function + ✔ throws on delete function failure + upsertScheduleV1 + ✔ upserts schedules + ✔ wraps errors + upsertScheduleV2 + ✔ upserts schedules + ✔ wraps errors + deleteScheduleV1 + ✔ deletes schedules and topics + ✔ wraps errors + deleteScheduleV2 + ✔ deletes schedules and topics + ✔ wraps errors + upsertTaskQueue + ✔ upserts task queues + ✔ sets enqueuer + ✔ wraps errors + disableTaskQueue + ✔ disables task queues + ✔ wraps errors + registerBlockingTrigger + ✔ registers auth blocking trigger + ✔ wraps errors + unregisterBlockingTrigger + ✔ unregisters auth blocking trigger + ✔ wraps errors + setTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers without channels + ✔ sets schedule triggers + ✔ sets task queue triggers + deleteTrigger + ✔ does nothing for HTTPS functions + ✔ does nothing for event triggers + ✔ deletes schedule triggers + ✔ deletes task queue triggers + createEndpoint + ✔ creates v1 functions + ✔ creates v2 functions + ✔ aborts for failures midway + updateEndpoint + ✔ updates v1 functions + ✔ updates v2 functions + ✔ aborts for failures midway + ✔ can delete and create + deleteEndpoint + ✔ deletes v1 functions + ✔ deletes v2 functions + ✔ does not delete functions with triggers outstanding + applyRegionalUpdates + ✔ shares source token scrapers across upserts + ✔ handles errors and wraps them in results + getLogSuccessMessage + ✔ should return appropriate messaging for create case + ✔ should return appropriate messaging for skip case + getSkippedDeployingNopOpMessage + ✔ should return appropriate messaging + applyPlan + ✔ fans out to regions + + planner + ✔ detects changes to v2 pubsub topics + ✔ detects upgrades to scheduled functions + calculateUpdate + ✔ throws on illegal updates + ✔ knows to delete & recreate for v2 topic changes + ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades + ✔ knows to delete & recreate when trigger regions change + ✔ knows to upgrade in-place in the general case + calculateRegionalChanges + ✔ passes a smoke test + ✔ adds endpoints with matching hashes to skip list + ✔ adds endpoints to update list if they dont have hashes + ✔ adds endpoints to update list if they have different hashes + ✔ does not add endpoints to skip list if not targeted for deploy + ✔ can be told to delete all functions + createDeploymentPlan + ✔ groups deployment by region and memory + ✔ applies filters + ✔ nudges users towards concurrency settings when upgrading and not setting + ✔ does not warn users about concurrency when inappropriate + checkForIllegalUpdate + ✔ prohibits upgrades from v1 to v2 + ✔ should throw if a https function would be changed into an event triggered function + ✔ should throw if a event triggered function would be changed into an https function + ✔ should throw if a scheduled trigger would change into an https function + ✔ should not throw if a event triggered function keeps the same trigger + ✔ should not throw if a https function stays as a https function + ✔ should not throw if a scheduled function stays as a scheduled function + ✔ should throw if a user downgrades from v2 to v1 + + reporter + triggerTag + ✔ detects v1.https + ✔ detects v2.https + ✔ detects v1.callable + ✔ detects v2.callable + ✔ detects v1.scheduled + ✔ detects v2.scheduled + ✔ detects v1.blocking + ✔ detects v2.blocking + ✔ detects others + logAndTrackDeployStats + ✔ tracks global summaries + ✔ tracks v1 vs v2 codebases + ✔ tracks overall success/failure + printErrors + ✔ does nothing if there are no errors + ✔ only prints summaries for non-aborted errors + ✔ prints IAM errors + ✔ prints quota errors + ✔ prints aborted errors + + SourceTokenScraper + ✔ immediately provides the first result + ✔ provides results after the first operation completes + ✔ provides tokens from an operation + ✔ refreshes token after timer expires (50ms) + ✔ concurrent requests for source token + + yamlToBuild + ✔ Accepts a valid v1alpha1 spec + ✔ Requires a spec version + ✔ Throws on unknown spec versions + + detectFromYaml + ✔ succeeds when YAML can be found + ✔ returns undefined when YAML cannot be found + + detectFromPort + ✔ passes as smoke test + + requireKeys + ✔ accepts found keys + ✔ throws for missing keys + ✔ uses prefixes in error messages + + assertKeyTypes + ✔ handles a null when expecting a string + ✔ handles a undefined when expecting a string + ✔ handles a number when expecting a string + ✔ handles a boolean when expecting a string + ✔ handles a string when expecting a string + ✔ handles a array when expecting a string + ✔ handles a object when expecting a string + ✔ handles a null when expecting a number + ✔ handles a undefined when expecting a number + ✔ handles a number when expecting a number + ✔ handles a boolean when expecting a number + ✔ handles a string when expecting a number + ✔ handles a array when expecting a number + ✔ handles a object when expecting a number + ✔ handles a null when expecting a boolean + ✔ handles a undefined when expecting a boolean + ✔ handles a number when expecting a boolean + ✔ handles a boolean when expecting a boolean + ✔ handles a string when expecting a boolean + ✔ handles a array when expecting a boolean + ✔ handles a object when expecting a boolean + ✔ handles a null when expecting a array + ✔ handles a undefined when expecting a array + ✔ handles a number when expecting a array + ✔ handles a boolean when expecting a array + ✔ handles a string when expecting a array + ✔ handles a array when expecting a array + ✔ handles a object when expecting a array + ✔ handles a null when expecting a object + ✔ handles a undefined when expecting a object + ✔ handles a number when expecting a object + ✔ handles a boolean when expecting a object + ✔ handles a string when expecting a object + ✔ handles a array when expecting a object + ✔ handles a object when expecting a object + ✔ handles a null when expecting a string? + ✔ handles a undefined when expecting a string? + ✔ handles a number when expecting a string? + ✔ handles a boolean when expecting a string? + ✔ handles a string when expecting a string? + ✔ handles a array when expecting a string? + ✔ handles a object when expecting a string? + ✔ handles a null when expecting a number? + ✔ handles a undefined when expecting a number? + ✔ handles a number when expecting a number? + ✔ handles a boolean when expecting a number? + ✔ handles a string when expecting a number? + ✔ handles a array when expecting a number? + ✔ handles a object when expecting a number? + ✔ handles a null when expecting a boolean? + ✔ handles a undefined when expecting a boolean? + ✔ handles a number when expecting a boolean? + ✔ handles a boolean when expecting a boolean? + ✔ handles a string when expecting a boolean? + ✔ handles a array when expecting a boolean? + ✔ handles a object when expecting a boolean? + ✔ handles a null when expecting a array? + ✔ handles a undefined when expecting a array? + ✔ handles a number when expecting a array? + ✔ handles a boolean when expecting a array? + ✔ handles a string when expecting a array? + ✔ handles a array when expecting a array? + ✔ handles a object when expecting a array? + ✔ handles a null when expecting a object? + ✔ handles a undefined when expecting a object? + ✔ handles a number when expecting a object? + ✔ handles a boolean when expecting a object? + ✔ handles a string when expecting a object? + ✔ handles a array when expecting a object? + ✔ handles a object when expecting a object? + ✔ handles validator functions + ✔ Throws on superfluous keys + ✔ Ignores 'omit' keys + ✔ Handles prefixes + + buildFromV1Alpha + parser errors + ✔ detects missing triggers + build keys + ✔ throws on the empty object + ✔ throws on invalid value for top-level key requiredAPIS + ✔ throws on invalid value for top-level key endpoints + ✔ throws on unknown keys + Endpoint keys + ✔ invalid keys + ✔ missing Endpoint key entryPoint + ✔ missing Endpoint key platform + ✔ missing Endpoint key project + ✔ missing Endpoint key region + ✔ missing Endpoint key runtime + ✔ invalid value for CloudFunction key platform + ✔ invalid value for CloudFunction key id + ✔ invalid value for CloudFunction key region + ✔ invalid value for CloudFunction key project + ✔ invalid value for CloudFunction key runtime + ✔ invalid value for CloudFunction key entryPoint + ✔ invalid value for CloudFunction key availableMemoryMb + ✔ invalid value for CloudFunction key maxInstances + ✔ invalid value for CloudFunction key minInstances + ✔ invalid value for CloudFunction key serviceAccount + ✔ invalid value for CloudFunction key timeoutSeconds + ✔ invalid value for CloudFunction key trigger + ✔ invalid value for CloudFunction key vpcConnector + ✔ invalid value for CloudFunction key vpcConnectorEgressSettings + ✔ invalid value for CloudFunction key labels + ✔ invalid value for CloudFunction key ingressSettings + ✔ invalid value for CloudFunction key cpu + Event triggers + ✔ missing event trigger key eventType + ✔ invalid value for event trigger key eventType + ✔ invalid value for event trigger key eventFilters + ✔ invalid value for event trigger key retry + ✔ invalid value for event trigger key region + ✔ invalid value for event trigger key serviceAccount + ✔ invalid value for event trigger key channel + httpsTriggers + ✔ invalid value for https trigger key invoker + scheduleTriggers + ✔ invalid value for schedule trigger key schedule + ✔ invalid value for schedule trigger key timeZone + blockingTriggers + ✔ invalid value for blocking trigger key eventType + ✔ invalid value for blocking trigger key options + null handling + ✔ handles null top-level keys + ✔ handles nulls in event triggers + ✔ handles null in https triggers + ✔ handles nulls in task queue triggers2 + ✔ handles null in scheduled triggers + Params + ✔ copies param fields + Endpoint keys + ✔ fills default backend and function fields + ✔ allows some fields of the endpoint to have a Field<> type + ✔ allows both CEL and lists containing CEL in FieldList typed keys + ✔ copies schedules + ✔ copies schedules including Field types + ✔ copies event triggers + ✔ copies event triggers with optional values + ✔ copies event triggers with optional values of Field<> types + ✔ copies event triggers with full resource path + ✔ copies blocking triggers + ✔ copies blocking triggers without options + ✔ copies optional fields + ✔ handles multiple regions + + getHumanFriendlyRuntimeName + ✔ should properly convert raw runtime to human friendly runtime + + extractTriggers + ✔ should find exported functions with __trigger + ✔ should attach name and entryPoint to exported triggers + ✔ should find nested functions and set name and entryPoint + ✔ should ignore null exports + + NodeDelegate + getNodeBinary + ✔ prefers locally cached node version if matched with requested version + ✔ checks if requested and hosted runtime version matches + ✔ warns users if hosted and requested runtime version differs + ✔ throws errors if requested runtime version is invalid + + getRuntimeChoice + when the runtime is set in firebase.json + ✔ should error if runtime field is set to node 6 + ✔ should error if runtime field is set to node 8 + ✔ should return node 10 if runtime field is set to node 10 + ✔ should return node 12 if runtime field is set to node 12 + ✔ should return node 14 if runtime field is set to node 14 + ✔ should return node 16 if runtime field is set to node 16 + ✔ should throw error if unsupported node version set + when the runtime is not set in firebase.json + ✔ should error if engines field is set to node 6 + ✔ should error if engines field is set to node 8 + ✔ should return node 10 if engines field is set to node 10 + ✔ should return node 12 if engines field is set to node 12 + ✔ should return node 14 if engines field is set to node 14 + ✔ should return node 16 if engines field is set to node 16 + ✔ should print warning when firebase-functions version is below 2.0.0 + ✔ should not throw error if user's SDK version fails to be fetched + ✔ should throw error if unsupported node version set + + addResourcesToBuild + ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend + ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend + ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend + ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend + ✔ should expand vpc connector in w/ shorthand form + ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend + ✔ should parse secret + + addResourcesToBackend + ✔ should assert against impossible configurations + ✔ should handle a minimal https trigger + ✔ should handle a callable trigger + ✔ should handle a minimal task queue trigger + ✔ should copy fields + ✔ should rename/transform fields + ✔ should support explicit regions + ✔ should support multiple regions + ✔ should support schedules + ✔ should expand vpc connector setting to full resource name + ✔ should preserve empty vpc connector setting + ✔ should parse secret + ✔ should parse a basic blocking trigger + ✔ should parse a blocking trigger with options + should handle a minimal event trigger + ✔ should handle failurePolicy=undefined + ✔ should handle failurePolicy=false + ✔ should handle failurePolicy=true + ✔ should handle failurePolicy={"retry":{}} + + validate + packageJsonIsValid + ✔ should throw error if package.json file is missing + ✔ should throw error if functions source file is missing + ✔ should throw error if main is defined and that file is missing + ✔ should not throw error if runtime is set in the config and the engines field is not set + + checkFunctionsSDKVersion + ✔ Should warn if the SDK version is too low + ✔ Should not warn for the latest SDK version + ✔ Should give an upgrade warning + ✔ Should give a breaking change warning + + PythonDelegate + getPythonBinary + ✔ returns specific version of the python binary corresponding to the runtime + ✔ returns generic python binary given non-recognized python runtime + ✔ always returns version-neutral, python.exe on windows + + authBlocking + validateBlockingTrigger + ✔ should throw an error if more than one beforeCreate blocking endpoint + ✔ should throw an error if more than one beforeSignIn blocking endpoint + ✔ should not throw on valid blocking endpoints + registerBlockingTrigger + ✔ should handle an empty config + ✔ should register on a new beforeCreate endpoint + ✔ should register on a new beforeSignIn endpoint + ✔ should do not set the config if the config is unchanged + unregisterBlockingTrigger + ✔ should not unregister a beforeCreate endpoint if uri does not match + ✔ should not unregister a beforeSignIn endpoint if the uri does not match + ✔ should unregister a beforeCreate endpoint + ✔ should unregister a beforeSignIn endpoint + ✔ should unregister a beforeSignIn endpoint that was registered to both event types + + ensureDatabaseTriggerRegion + ✔ should set the trigger location to the function region + ✔ should not error if the trigger location is already set correctly + ✔ should error if the trigger location is set incorrectly + + ensureFirebaseAlertsTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + ensureFirestoreTriggerRegion + ✔ should throw an error if the trigger region is different than the firestore region + ✔ should not throw if the trigger region is not set + ✔ should not throw if the trigger region is set correctly + + ensureRemoteConfigTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + obtainStorageBindings + ✔ should return the correct storage binding + + ensureTestLabTriggerRegion + ✔ should set the trigger location to global + ✔ should not error if the trigger location is global + ✔ should error if the trigger location is not global + + TriggerRegionHelper + ensureTriggerRegions + ✔ should throw an error if we can't find the bucket region + ✔ should skip v1 and callable functions + ✔ should set trigger region from API + ✔ should set trigger region from API then reject on invalid function region + + validate + functionsDirectoryExists + ✔ should not throw error if functions directory is present + ✔ should throw error if the functions directory does not exist + functionNamesAreValid + ✔ should allow properly formatted function names + ✔ should throw error on improperly formatted function names + ✔ should throw error if some function names are improperly formatted + - should throw error on empty function names + ✔ should not throw error on capital letters in v2 function names + ✔ should not throw error on underscores in v2 function names + endpointsAreValid + ✔ disallows concurrency for GCF gen 1 + ✔ Disallows concurrency for low-CPU gen 2 + ✔ does not throw for valid CPU undefined + ✔ does not throw for valid CPU gcf_gen1 + ✔ does not throw for valid CPU 0.1 + ✔ does not throw for valid CPU 0.5 + ✔ does not throw for valid CPU 1 + ✔ does not throw for valid CPU 2 + ✔ does not throw for valid CPU 4 + ✔ does not throw for valid CPU 6 + ✔ does not throw for valid CPU 8 + ✔ throws for gcfv1 with CPU + ✔ disallows large CPU in low-CPU regionaustralia-southeast2 + ✔ disallows large CPU in low-CPU regionasia-northeast3 + ✔ disallows large CPU in low-CPU regionasia-south2 + ✔ allows valid CPU size 0.08 + ✔ allows valid CPU size 0.5 + ✔ allows valid CPU size 1 + ✔ allows valid CPU size 2 + ✔ allows valid CPU size 4 + ✔ allows valid CPU size 6 + ✔ allows valid CPU size 8 + ✔ allows valid CPU size gcf_gen1 + ✔ disallows CPU size 0.07 + ✔ disallows CPU size 1.1 + ✔ disallows CPU size 3 + ✔ disallows CPU size 5 + ✔ disallows CPU size 7 + ✔ disallows CPU size 9 + ✔ disallows tiny CPU with large memory + ✔ disallows small CPU with huge memory + ✔ enforces minimum memory for 4 CPU + ✔ enforces minimum memory for 6 CPU + ✔ enforces minimum memory for 8 CPU + ✔ allows gcfv2 endpoints with mem 128 and no cpu + ✔ allows gcfv2 endpoints with mem 256 and no cpu + ✔ allows gcfv2 endpoints with mem 512 and no cpu + ✔ allows gcfv2 endpoints with mem 1024 and no cpu + ✔ allows gcfv2 endpoints with mem 2048 and no cpu + ✔ allows gcfv2 endpoints with mem 4096 and no cpu + ✔ allows gcfv2 endpoints with mem 8192 and no cpu + ✔ allows gcfv2 endpoints with mem 16384 and no cpu + ✔ allows gcfv2 endpoints with mem 32768 and no cpu + ✔ allows endpoints with no mem and no concurrency + ✔ allows endpoints with mem and no concurrency + ✔ allows explicitly one concurrent + ✔ allows endpoints with enough mem and no concurrency + ✔ allows endpoints with enough mem and explicit concurrency + ✔ disallows concurrency with too little memory (implicit) + ✔ Disallows concurrency with too little cpu (explicit) + ✔ disallows multiple beforeCreate blocking + ✔ disallows multiple beforeSignIn blocking + ✔ Allows valid blocking functions + endpointsAreUnqiue + ✔ passes given unqiue ids + ✔ passes given unique id, region pairs + ✔ throws given non-unique id region pairs + ✔ throws given non-unique id region pairs across all codebases + ✔ throws given multiple conflicts + secretsAreValid + ✔ passes validation with empty backend + ✔ passes validation with no secret env vars + ✔ fails validation given non-existent secret version + ✔ fails validation given non-existent secret version + ✔ fails validation given disabled secret version + ✔ passes validation and resolves latest version given valid secret config + + convertConfig + ✔ returns rewrites for glob destination + ✔ returns rewrites for regex destination + ✔ checks for function region if unspecified + ✔ discovers the function region of a callable function + ✔ returns rewrites for glob CF3 + ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition + ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition + ✔ returns rewrites for regex CF3 + ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) + ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) + ✔ returns rewrites for glob Run + ✔ returns rewrites for regex Run + ✔ return rewrites for Cloud Run instances being deployed (during release) + ✔ returns the specified rewrite even if it's not found + ✔ returns rewrites for Run with specified regions + ✔ returns rewrites for glob Dynamic Links + ✔ returns rewrites for regex Dynamic Links + ✔ returns glob redirects without a specified code/type + ✔ returns regex redirects without a specified code/type + ✔ returns glob redirects with a specified code/type + ✔ returns no headers if they weren't specified + ✔ returns glob headers as a map + ✔ returns regex headers as a map + ✔ returns clean URLs when it is false + ✔ returns clean URLs when it is true + ✔ returns trailing slash as ADD when true + ✔ returns trailing slash as REMOVE when false + ✔ returns app association as it is set + ✔ returns i18n as it is set + ✔ rewrites v2 functions tags + ✔ rewrites run tags + rewrites errors + ✔ should throw when rewrite points to function in the wrong region (104ms) + ✔ should throw when rewrite points to function being deleted (52ms) + with permissions issues + ✔ should not throw when resolving backends + + hashcache + ✔ should return an empty object if a file doesn't exist + ✔ should be able to dump configuration to a file + ✔ should be able to load configuration from a file + + hosting prepare + ✔ passes a smoke test with web framework + ✔ passes a smoke test without web framework + unsafePins + ✔ does not care about modifying live (implicit) + ✔ does not care about modifying live (explicit) + ✔ does not care about already pinned rewrites (run) + ✔ does not care about already pinned rewrites (gcf) + ✔ rejects about newly pinned rewrites (run) + ✔ rejects about newly pinned rewrites (gcf) + hasPinnedFunctions + ✔ detects function tags + ✔ detects a lack of function tags + addPinnedFunctionsToOnlyString + ✔ adds functions to deploy targets w/ codebases + ✔ adds functions to deploy targets w/o codebases + ✔ doesn't add untagged functions + + release + with no Hosting deploys + ✔ should bail + a single site + ✔ should update a version and make a release + ✔ should update a version and make a release with a message + multiple sites + ✔ should update a version and make a release + to a hosting channel + ✔ should update a version and make a release + + Remote Config Deploy + Publish the updated template + ✔ should publish the latest template + ✔ should publish the latest template with * etag + ✔ should reject if the api call fails + + storage.release + ✔ should not release anything if there are no deployable configs + ✔ should release rules for a single deploy config + ✔ should release rules based on targets + + downloadToTmp + ✔ should download a file + ✔ should throw an error on non-200 code + + adminSdkConfig + getProjectAdminSdkConfigOrCached + ✔ should return a fake config for a demo project id + + Auth Emulator: accounts:batchGet + ✔ should allow listing all accounts + ✔ should return MFA info + ✔ should allow listing all accounts using legacy endpoint + ✔ should allow specifying maxResults and pagination + ✔ should always return a page token if page is full + ✔ should error if auth is disabled + + Auth Emulator: accounts:batchCreate + ✔ should create specified accounts + ✔ should create specified accounts via legacy endpoint + ✔ should error if users is empty or missing + ✔ should convert emails to lowercase + ✔ should accept Auth Emulator fake passwordHash from request + - should reject production passwordHash + ✔ should error for duplicate emails in payload if sanityCheck is true + ✔ should block reusing existing email if sanityCheck is true + ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true + ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true + ✔ should block duplicate localIds by default + ✔ should not error for empty MFA info + ✔ should return error for individual invalid entries + ✔ should overwrite users with matching localIds if allowOverwrite + ✔ should import identity provider info + ✔ should import MFA info + ✔ should error if auth is disabled + ✔ should error if user tenantId does not match state tenantId + ✔ should create users with tenantId if present + + Auth Emulator: accounts:batchDelete + ✔ should delete specified disabled accounts + ✔ should error for accounts not disabled + ✔ should delete disabled and not disabled accounts with force: true + ✔ should not report errors for nonexistent localIds + ✔ should error if localIds array is empty + ✔ should error if localId count is more than limit + + cloudFunctions + dispatch + ✔ should make a request to the functions emulator + + Auth Emulator: config management + updateConfig + ✔ updates the project level config + ✔ does not update if the field does not exist on the update config + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + ✔ should error when updating an invalid blocking function event + ✔ should error if functionUri is invalid + getConfig + ✔ should return the project level config + ✔ should return updated config fields + + Auth Emulator: accounts:createAuthUri + ✔ should report not registered user as not registered + ✔ should return providers for a registered user + ✔ should return existing sessionId if provided + ✔ should find user by email ignoring case + ✔ should find user by either IDP email or 'top-level' email + ✔ should not list IDP sign-in methods when allowDuplicateEmails + ✔ should error if identifier or continueUri is not provided + ✔ should error if identifier is invalid + ✔ should error if continueUri is invalid + ✔ should error if auth is disabled + + Auth Emulator: sign-in with custom token + ✔ should create new account from custom token (unsigned) + ✔ should sign into existing account and merge claims + ✔ should error if custom token is missing + ✔ should error if custom token is invalid + ✔ should error if custom token addresses the wrong audience + ✔ should error if custom token contains no uid + ✔ should error if custom token contains forbidden claims + ✔ should error if user is disabled + ✔ should error if auth is disabled + ✔ should error if custom token tenantId does not match + ✔ should create a new account from custom token with tenantId + + Auth Emulator: accounts:delete + ✔ should delete the user of the idToken + ✔ should error when trying to delete by localId without OAuth + ✔ should remove federated accounts for user + ✔ should delete the user by localId if OAuth credentials are present + ✔ should error if missing localId when OAuth credentials are present + ✔ should delete the user of the idToken + + Auth Emulator: email link sign-in + ✔ should send OOB code to new emails and create account on sign-in + ✔ should sign an existing account in and enable email-link sign-in for them + ✔ should error on invalid oobCode + ✔ should error if user is disabled + ✔ should error if email mismatches + ✔ should link existing account with idToken to new email + ✔ should link existing phone-auth account to new email + ✔ should error when trying to link an email already used in another account + ✔ should error if user to be linked is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if email link sign in is disabled + ✔ should create account on sign-in with tenantId + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields for account creation + ✔ should pass user info in the request body to beforeCreate + ✔ should pass user info in the request body to beforeSignIn + ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate + ✔ should update modifiable fields before sign in + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should update modifiable fields before sign in for existing accounts + ✔ should error after disabling user + + Auth Emulator: sign-in with credential + ✔ should create new account with IDP from unsigned ID token + ✔ should create new account with IDP from production ID token + ✔ should create new account with IDP from unencoded JSON claims + ✔ should accept params (e.g. providerId, id_token) in requestUri + ✔ should copy attributes to user on IDP sign-up + ✔ should allow duplicate emails if set in project config + ✔ should sign-up new users without copying email when allowing duplicate emails + ✔ should allow multiple providers with same email when allowing duplicate emails + ✔ should sign in existing account if (providerId, sub) is the same + ✔ should error if user is disabled + ✔ should add IDP as a sign-in method for email if available + ✔ should unlink password and overwite profile attributes if user had unverified email + ✔ should not unlink password if email was already verified + ✔ should return needConfirmation if both account and IDP has unverified email + ✔ should error when requestUri is missing or invalid + ✔ should error when missing providerId is missing + ✔ should error when sub is missing or not a string + ✔ should link IDP to existing account by idToken + ✔ should copy IDP email to user-level email if not present + ✔ should error if user to be linked is disabled + ✔ should return pending credential for MFA-enabled user + ✔ should link IDP for existing MFA-enabled user + ✔ should return error if IDP account is already linked to the same user + ✔ should return error if IDP account is already linked to another user + ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail + ✔ should allow linking IDP account with same email to same user + ✔ should allow linking IDP account with same email if allowDuplicateEmail + ✔ should error if auth is disabled + ✔ should create a new account with tenantId + ✔ should return pending credential for MFA-enabled user and enabled on tenant project + ✔ should error if SAMLResponse is missing assertion + ✔ should error if SAMLResponse is missing assertion.subject + ✔ should error if SAMLResponse is missing assertion.subject.nameId + ✔ should create an account for generic SAML providers + ✔ should include fields in SAMLResponse for SAML providers + when blocking functions are present + ✔ should update modifiable fields for new users for beforeCreate + ✔ should update modifiable fields for new users for beforeSignIn + ✔ beforeSignIn fields should overwrite beforeCreate fields for new users + ✔ should update modifiable fields for existing users + ✔ should disable user if set + + Auth Emulator: mfa enrollment + ✔ should error if account does not have email verified + ✔ should allow phone enrollment for an existing account + ✔ should error if phoneEnrollmentInfo is not specified + ✔ should error if phoneNumber is invalid + ✔ should error if phoneNumber is a duplicate + ✔ should error if sign-in method of idToken is ineligible for MFA + ✔ should error on mfaEnrollment:start if auth is disabled + ✔ should error on mfaEnrollment:start if MFA is disabled + ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider + ✔ should error on mfaEnrollment:finalize if auth is disabled + ✔ should error on mfaEnrollment:finalize if MFA is disabled + ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider + ✔ should allow sign-in with pending credential for MFA-enabled user + ✔ should error on mfaSignIn:start if auth is disabled + ✔ should error on mfaSignIn:start if MFA is disabled + ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider + ✔ should error on mfaSignIn:finalize if auth is disabled + ✔ should error on mfaSignIn:finalize if MFA is disabled + ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider + ✔ should allow withdrawing MFA for a user + ✔ should error on mfaEnrollment:withdraw if auth is disabled + when blocking functions are present + ✔ mfaSignIn:finalize should update modifiable fields before sign in + ✔ mfaSignIn:finalize should disable user if set + + Auth Emulator: token refresh + ✔ should exchange refresh token for new tokens + ✔ should exchange refresh tokens for new tokens in a tenant project + ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) + ✔ should error if grant type is missing + ✔ should error if grant type is not refresh_token + ✔ should error if refresh token is missing + ✔ should error on malformed refresh tokens + ✔ should error if user is disabled + ✔ should error when refresh tokens are from a different project + ✔ should error on refresh tokens without required fields + ✔ should error if the refresh token is for a user that does not exist + + Auth Emulator: createSessionCookie + ✔ should return a valid sessionCookie + ✔ should throw if idToken is missing + ✔ should throw if idToken is invalid + ✔ should use default session cookie validDuration if not specified + ✔ should throw if validDuration is too short or too long + + Auth Emulator: accounts:lookup + ✔ should return user by localId when privileged + ✔ should deduplicate users + ✔ should return providerUserInfo for phone auth users + ✔ should return empty result when localId is not found + ✔ should return user by tenantId in idToken + ✔ should error if auth is disabled + + Auth Emulator: accounts:query + ✔ should return count of accounts when returnUserInfo is false + ✔ should return accounts when returnUserInfo is true + ✔ should error if auth is disabled + + Auth Emulator: emulator utility APIs + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts + ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts + ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config + ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING + ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config + + Auth Emulator: emulator utility API; singleProjectMode=ERROR + ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR + + Auth Emulator: accounts:sendOobCode + ✔ should generate OOB code for verify email + ✔ should return OOB code directly for requests with OAuth 2 + ✔ should return OOB code by idToken for OAuth 2 requests as well + ✔ should error when trying to verify email without idToken or email + ✔ should error when trying to verify email without idToken if not returnOobLink + ✔ should error when trying to verify email not associated with any user + ✔ should error when verifying email for accounts without email + ✔ should error if user is disabled + ✔ should error when continueUrl is invalid + ✔ should error if auth is disabled + ✔ should error for email sign in if not enabled + ✔ should generate OOB code for reset password + ✔ should return purpose of oobCodes via resetPassword endpoint + ✔ should error on resetPassword if auth is disabled + ✔ should error on resetPassword if password sign up is disabled + + Auth Emulator: accounts:signInWithPassword + ✔ should issue tokens when email and password are valid + ✔ should update lastLoginAt on successful login + ✔ should validate email address ignoring case + ✔ should error if email or password is missing + ✔ should error if email is invalid + ✔ should error if email is not found + ✔ should error if password is wrong + ✔ should error if user is disabled + ✔ should return pending credential if user has MFA + ✔ should error if auth is disabled + ✔ should error if password sign up is disabled + ✔ should return pending credential if user has MFA and enabled on tenant projects + when blocking functions are present + ✔ should update modifiable fields before sign in + ✔ should disable user if set + ✔ should not trigger blocking function if user has MFA + + Auth Emulator: phone auth sign-in + ✔ should return fake recaptcha params + ✔ should pretend to send a verification code via SMS + ✔ should error when phone number is missing when calling sendVerificationCode + ✔ should error when phone number is invalid + ✔ should error on sendVerificationCode if auth is disabled + ✔ should error on sendVerificationCode for tenant projects + ✔ should create new account by verifying phone number + ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber + ✔ should error when sessionInfo or code is invalid + ✔ should error if user is disabled + ✔ should link phone number to existing account by idToken + ✔ should error if user to be linked is disabled + ✔ should error when linking phone number to existing user with MFA + ✔ should error if user has MFA + ✔ should return temporaryProof if phone number already belongs to another account + ✔ should error if auth is disabled + ✔ should error if called on tenant project + when blocking functions are present + ✔ should update modifiable fields for new users + ✔ should update modifiable fields for existing users + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable user if set + + Auth Emulator: REST API mapping + ✔ should respond to status checks + ✔ should allow cross-origin requests + ✔ should handle integer values for enums + ✔ should handle integer values for enums (legacy API path) + ✔ should convert numbers to strings for type:string fields + + Auth Emulator: authentication + ✔ should throw 403 if API key is not provided + ✔ should accept API key as a query parameter + ✔ should accept API key in HTTP Header x-goog-api-key + ✔ should ignore non-Bearer Authorization headers + ✔ should treat Bearer owner as authenticated to project + ✔ should ignore casing of Bearer / owner in Authorization header + ✔ should treat production service account as authenticated to project + ✔ should deny requests with targetProjectId but without OAuth 2 + ✔ should deny requests where tenant IDs do not match in the request body and path + ✔ should deny requests where tenant IDs do not match in the ID token and path + ✔ should deny requests where tenant IDs do not match in the ID token and request body + + Auth Emulator: accounts:update + ✔ should allow updating and deleting displayName and photoUrl + ✔ should set password and issue new tokens + ✔ should add password provider to anon user + ✔ should allow adding email without password to anon user + ✔ should allow changing email of an existing user, and send out an oob to reset the email + ✔ should disallow setting email to same as an existing user + ✔ should set initialEmail for the user, after updating email + ✔ should reset email when OOB flow is initiated, after updating user email + ✔ should disallow resetting an email if another user exists with the same email + ✔ should not set initial email or send OOB when anon user updates email + ✔ should not update email if user is disabled + ✔ should update phoneNumber if specified + ✔ should noop when setting phoneNumber to the same as before + ✔ should disallow setting phone to same as an existing user + ✔ should error if phoneNumber is invalid + ✔ should allow creating MFA info + ✔ should allow adding a second MFA factor + ✔ should allow changing the MFA phone number + ✔ should allow changing the MFA enrollment ID + ✔ should overwrite existing MFA info + ✔ should remove MFA info with an empty enrollments array + ✔ should remove MFA info with an undefined enrollments array + ✔ should error if mfaEnrollmentId is absent + ✔ should de-duplicate MFA factors with the same phone number + ✔ should error if MFA Enrollment ID is duplicated for different phone numbers + ✔ does not require MFA Enrollment ID uniqueness across users + ✔ should error if phone number for MFA is invalid + ✔ should error if user for MFA update is not found + ✔ should error if enrollments is not an array or undefined + ✔ should error if user is disabled when updating by idToken + ✔ should still update user despite user is disabled when authenticated + ✔ should invalidate old tokens after updating validSince or password + ✔ should delete password provider from user + ✔ should delete phone provider from user + ✔ should delete google.com provider from user + ✔ should update user by localId when authenticated + ✔ should error if authenticated request does not specify localId + ✔ should update customAttributes and add them to ID Tokens + ✔ should error if customAttributes are invalid + ✔ should error if auth is disabled + ✔ should set tenantId in oobLink + + Auth Emulator: accounts:signUp + ✔ should throw error if no email provided + ✔ should throw error if empty email and password is provided + ✔ should issue idToken and refreshToken on anon signUp + ✔ should issue refreshToken on email+password signUp + ✔ should ignore displayName and photoUrl for new anon account + ✔ should set displayName but ignore photoUrl for new password account + ✔ should disallow duplicate email signUp + ✔ should error if another account exists with same email from IDP + ✔ should error when email format is invalid + ✔ should normalize email address to all lowercase + ✔ should error when password is too short + ✔ should error when idToken is provided but email / password is not + ✔ should link email and password to anon user if idToken is provided + ✔ should link email and password to phone sign-in user + ✔ should error if account to be linked is disabled + ✔ should replace existing email / password in linked account + ✔ should create new account with phone number when authenticated + ✔ should error when extra localId parameter is provided + ✔ should create new account with specified localId when authenticated + ✔ should error when creating new user with duplicate localId + ✔ should error if phone number is invalid + ✔ should create new account with multi factor info + ✔ should create new account with two MFA factors + ✔ should de-duplicate factors with the same info on create + ✔ does not require a display name for multi factor info + ✔ should error if multi factor phone number is invalid + ✔ should ignore if multi factor enrollment ID is specified on create + ✔ should error if auth is disabled + ✔ should error if password sign up is not allowed + ✔ should error if anonymous user is disabled + ✔ should create new account with tenant info + when blocking functions are present + ✔ should update modifiable fields with beforeCreate response for a new email/password user + ✔ should update modifiable fields with beforeSignIn response for a new email/password user + ✔ beforeSignIn fields should overwrite beforeCreate fields + ✔ should disable new user if set + ✔ should not trigger blocking functions for privileged requests + + Auth Emulator: tenant management + createTenant + ✔ should create tenants + ✔ should create a tenant with default disabled settings + getTenants + ✔ should get tenants + ✔ should create tenants with default enabled settings if they do not exist + deleteTenants + ✔ should delete tenants + ✔ should delete tenants if request body is passed + listTenants + ✔ should list tenants + ✔ should allow specifying pageSize and pageToken + ✔ should always return a page token even if page is full + updateTenants + ✔ updates tenant config + ✔ does not update if the field does not exist on the update tenant + ✔ does not update if indexing a primitive field or array on the update tenant + ✔ performs a full update if the update mask is empty + ✔ performs a full update with production defaults if the update mask is empty + + commandUtils + ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option + ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option + ✔ Should disallow the user to set the current folder via the --import flag + ✔ should validate --export-on-exit options + ✔ should delete the --import option when the dir does not exist together with --export-on-exit + ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set + ✔ should keep other unrelated options when using setExportOnExitOptions + Mocked path resolve + ✔ Should not block if destination contains a match to the CWD + + EmulatorController + ✔ should start and stop an emulator (74ms) + + Resolver + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupFirst + ✔ should return the first value of result + ✔ should prefer IPv4 addresss using the underlying lookup + ✔ should return cached result if available + ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address + ✔ should parse and return IPv4 addresses without lookup + ✔ should parse and return IPv6 addresses without lookup + #lookupAll + ✔ should return all addresses returned + ✔ should request IPv4 addresses to be listed first using the underlying lookup + ✔ should return cached results if available + ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) + + downloadDetails + ✔ should match the basename of remoteUrl + + eventarcEmulatorUtils + cloudEventFromProtoToJson + ✔ converts cloud event from proto format + ✔ throws invalid argument when source not set + ✔ populates converts object data to JSON and sets datacontenttype + ✔ populates string data and sets datacontenttype + ✔ allows optional attribute to not be set + + replaceConsoleLinks + ✔ should replace Firestore links + ✔ should replace Functions links + ✔ should replace Extensions links + ✔ should replace RTDB links + ✔ should replace Auth links + ✔ should replace multiple GAIA user links + ✔ should replace multiple links + ✔ should not replace other links + + ExtensionsEmulator validation + getUnemulatedAPIs + ✔ should check only unemulated APIs + ✔ should not check on demo- projects + checkForUnemulatedTriggerTypes + ✔ should return trigger types for emulators that are not running + ✔ should return trigger types that don't have an emulator + ✔ should not return duplicates + ✔ should not return trigger types for emulators that are running + ✔ should not return trigger types for https triggers + + Extensions Emulator + toEmulatableBackends + ✔ should transform a instance spec to a backend + installAndBuildSourceCode + ✔ installs dependecies (8598ms) + + FunctionsEmulatorShared + getFunctionService + ✔ should get service from event trigger definition + ✔ should infer https service from http trigger + ✔ should infer pubsub service based on eventType + ✔ should infer firestore service based on eventType + ✔ should infer database service based on eventType + ✔ should infer storage service based on eventType + ✔ should infer auth service based on eventType + getSecretLocalPath + ✔ should return the correct location for an Extension backend + ✔ should return the correct location for a CF3 backend + toBackendInfo + ✔ should transform a published Extension backend + ✔ should transform a local Extension backend + ✔ should transform a CF3 backend + ✔ should add secretEnvVar into env + + FunctionsEmulatorUtils + extractParamsFromPath + ✔ should match a path which fits a wildcard template + ✔ should not match unfilled wildcards + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + isValidWildcardMatch + ✔ should match a path which fits a wildcard template + ✔ should not match a path which is too long + ✔ should not match a path which is too short + ✔ should not match a path which has different chunks + trimSlashes + ✔ should remove leading and trailing slashes + ✔ should replace multiple adjacent slashes with a single slash + ✔ should do both + compareVersonStrings + ✔ should detect a higher major version + ✔ should detect a higher minor version + ✔ should detect a higher patch version + ✔ should detect the same version + parseRuntimeVerson + ✔ should parse fully specified runtime strings + ✔ should parse plain number strings + ✔ should ignore unknown + isLocalHost + ✔ should return true for localhost + ✔ should return true for 127.0.0.1 + ✔ should return true for ipv6 loopback + ✔ should work with https + ✔ should return false for external uri + ✔ should return false for external ip + + FunctionsRuntimeWorker + RuntimeWorker + ✔ goes from created --> idle --> busy --> idle in normal operation + ✔ goes from created --> idle --> busy --> finished when there's an error + ✔ goes from created --> busy --> finishing --> finished when marked + RuntimeWorkerPool + ✔ properly manages a single worker + ✔ does not consider failed workers idle + ✔ exit() kills idle and busy workers + ✔ refresh() kills idle workers and marks busy ones as finishing + ✔ gives assigns all triggers to the same worker in sequential mode + + EmulatorRegistry + ✔ should not report any running emulators when empty + ✔ should correctly return information about a running emulator (92ms) + ✔ once stopped, an emulator is no longer running (78ms) + #url + ✔ should craft URL from host and port in registry (75ms) + ✔ should quote IPv6 addresses (76ms) + ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) + ✔ should use ::1 instead of :: (162ms) + ✔ should use protocol from request if available (75ms) + ✔ should use host from request if available (77ms) + + crc + ✔ correctly computes crc32c from a string + ✔ correctly computes crc32c from bytes + ✔ correctly stringifies crc32c + + files + ✔ can serialize and deserialize metadata + ✔ converts non-string custom metadata to string + StorageLayer + #uploadObject() + ✔ should throw if upload is not finished + ✔ should throw if upload is not authorized + #getObject() + ✔ should return data and metadata + ✔ should throw an error if request is not authorized + ✔ should throw an error if the object does not exist + + toSerializedDate + ✔ correctly serializes date + ✔ correctly serializes date with different timezone + + Storage Multipart Request Parser + #parseObjectUploadMultipartRequest() + ✔ parses an upload object multipart request successfully + ✔ parses an upload object multipart request with non utf-8 data successfully + ✔ parses an upload object multipart request with lowercase content-type + ✔ fails to parse with invalid Content-Type value + ✔ fails to parse with invalid boundary value + ✔ parses an upload object multipart request with additional quotes in the boundary value + ✔ fails to parse when body has wrong number of parts + ✔ fails to parse when body part has invalid content type + ✔ fails to parse when body part is malformed + + Persistence + #deleteFile() + ✔ should delete files + #readBytes() + ✔ should read existing files + ✔ should handle really long filename read existing files + #copyFromExternalPath() + ✔ should copy files existing files + + Storage Rules Config + ✔ should parse rules config for single target + ✔ should use default config for project IDs using demo- prefix if no rules file exists + ✔ should use provided config for project IDs using demo- prefix if the provided config exists + ✔ should parse rules file for multiple targets + ✔ should throw FirebaseError when storage config is missing + ✔ should throw FirebaseError when rules file is missing + ✔ should throw FirebaseError when rules file is invalid + + WorkQueue + mode=AUTO + ✔ never runs a job immediately + ✔ runs two jobs + ✔ never runs more than the maximum allowed parallel work (116ms) + mode=SEQUENTIAL + ✔ finishes one job before running another (122ms) + ✔ proceeds even if a job errors out + + ensureApiEnabled + check + ✔ should call the API to check if it's enabled + ✔ should return the value from the API + ensure + ✔ should verify that the API is enabled, and stop if it is + ✔ should attempt to enable the API if it is not enabled + ✔ should retry enabling the API if it does not enable in time + + error + FirebaseError + ✔ should be an instance of Error + ✔ should apply default options + ✔ should persist all options + + experiments + enableExperimentsFromCliEnvVariable + ✔ should enable some experiments + + checkAllowedEventTypesResponse + ✔ should return false if allowed events is not part of extension spec's events list + ✔ should return true if every allowed event exists in extension spec's events list + + askForAllowedEventTypes + ✔ should keep prompting user until valid input is given + + askForEventarcLocation + ✔ should keep prompting user until valid input is given + + askUserForParam + checkResponse + ✔ should return false if required variable is not set + ✔ should return false if regex validation fails + ✔ should return false if regex validation fails on an optional param that is not empty + ✔ should return true if no value is passed for an optional param + ✔ should not check against list of options if no value is passed for an optional SELECT + ✔ should not check against list of options if no value is passed for an optional MULTISELECT + ✔ should use custom validation error message if provided + ✔ should return true if all conditions pass + ✔ should return false if an invalid choice is selected + ✔ should return true if an valid choice is selected + ✔ should return false if multiple invalid choices are selected + ✔ should return true if one valid choice is selected + ✔ should return true if multiple valid choices are selected + getInquirerDefaults + ✔ should return the label of the option whose value matches the default + ✔ should return the value of the default option if it doesnt have a label + ✔ should return an empty string if a default option is not found + askForParam with string param + ✔ should keep prompting user until valid input is given + askForParam with secret param + ✔ should return the correct user input for secret stored with Secret Manager + ✔ should return the correct user input for secret stored in a local file + ✔ should handle cloud & local secret storage at the same time + ask + ✔ should call substituteParams with the right parameters + + billingMigrationHelper + displayNode10CreateBillingNotice + ✔ should notify the user if the runtime requires nodejs10 + ✔ should notify the user if the runtime does not require nodejs (explicit) + ✔ should notify the user if the runtime does not require nodejs (implicit) + ✔ should error if the user doesn't give consent + + changelog + GetReleaseNotesForUpdate + ✔ should return release notes for each version in the update + ✔ should exclude versions that don't have releaseNotes + breakingChangesInUpdate + ✔ should return no breaking changes + ✔ should return prerelease breaking change + ✔ should return breaking change + ✔ should return multiple breaking changes + parseChangelog + ✔ should split changelog by version + ✔ should ignore text not in a version + ✔ should handle prerelease versions + + checkProjectBilling + ✔ should resolve if billing enabled + ✔ should list accounts if no billing account set, but accounts available. + ✔ should not list accounts if no billing accounts set or available. + + diagnose + ✔ should succeed when IAM policy is correct (no fix) + ✔ should fail when project IAM policy missing extensions service agent (no fix) + ✔ should fix the project IAM policy by adding missing bindings + + displayExtensionInfo + displayExtInfo + ✔ should display info during install + ✔ should display additional information for a published extension + ✔ should display role and api for Cloud Tasks during install + ✔ should display role for Cloud Secret Manager during install + + optionsHelper + getParams + ✔ should return user and autopopulated params + ✔ should subsitute into params that reference other params + ✔ should fallback to defaults if a value isn't provided + getNonSecretEnv + ✔ should return only params that are not secret + getSecretEnv + ✔ should return only params that are secret + + getRuntime + ✔ gets runtime of resources + ✔ chooses the latest runtime if many runtime exists + ✔ returns default runtime if none specified + ✔ returns default runtime given no resources + ✔ throws error given invalid runtime + + triggerHelper + functionResourceToEmulatedTriggerDefintion + ✔ should assign valid properties from the resource to the ETD and ignore others + ✔ should handle HTTPS triggers + ✔ should handle firestore triggers + ✔ should handle database triggers + ✔ should handle pubsub triggers + ✔ should handle scheduled triggers + ✔ should handle v2 custom event triggers + ✔ should handle fully packed v2 triggers + ✔ should correctly inject system params + + detectEtagChanges + ✔ should not detect changes if there is no previously saved etags + ✔ should detect changes if a new instance was installed out of band + ✔ should detect changes if an instance was changed out of band + ✔ should detect changes if an instance was deleted out of band + + ext:export helpers + parameterizeProject + ✔ should strip projectId + ✔ should strip projectNumber + ✔ should not affect other params + setSecretVersionsToLatest + ✔ Should set active secrets to latest + + extensions + listInstances + ✔ should return a list of installed extensions instances + ✔ should query for more installed extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + createInstance + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref + ✔ should make a POST and not poll if validateOnly=true + ✔ should throw a FirebaseError if create returns an error response + configureInstance + ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + deleteInstance + ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if delete returns an error response + updateInstance + ✔ should include config.params in updateMask is params are changed + ✔ should not include config.params or config.system_params in updateMask is params aren't changed + ✔ should include config.system_params in updateMask if system_params are changed + ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should make a PATCH and not poll if validateOnly=true + ✔ should throw a FirebaseError if update returns an error response + getInstance + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + getSource + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + createSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if create returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + extensionsHelper + ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax + substituteParams + ✔ should substitute env variables + getDBInstanceFromURL + ✔ returns the correct instance name + populateDefaultParams + ✔ should set default if default is available + ✔ should throw error if no default is available + validateCommandLineParams + ✔ should throw error if param variable value is invalid + ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml + ✔ should throw an error if a required param is missing + ✔ should not throw a error if a non-required param is missing + ✔ should not throw a regex error if a non-required param is missing + ✔ should throw a error if a param value doesn't pass the validation regex + ✔ should throw a error if a multiselect value isn't an option + ✔ should throw a error if a multiselect param is missing options + ✔ should throw a error if a select param is missing options + ✔ should not throw if a select value is an option + ✔ should not throw if all multiselect values are options + validateSpec + ✔ should not error on a valid spec + ✔ should error if license is missing + ✔ should error if license is invalid + ✔ should error if name is missing + ✔ should error if specVersion is missing + ✔ should error if version is missing + ✔ should error if a resource is malformed + ✔ should error if an api is malformed + ✔ should error if a param is malformed + ✔ should error if a STRING param has options. + ✔ should error if a select param has validationRegex. + ✔ should error if a param has an invalid type. + ✔ should error if a param selectResource missing resourceType. + promptForValidInstanceId + ✔ should prompt the user and return if the user provides a valid id + ✔ should prompt the user again if the provided id is shorter than 6 characters + ✔ should prompt the user again if the provided id is longer than 45 characters + ✔ should prompt the user again if the provided id ends in a - + ✔ should prompt the user again if the provided id starts with a number + ✔ should prompt the user again if the provided id contains illegal characters + createSourceFromLocation + ✔ should upload local sources to Firebase Storage then create an ExtensionSource + ✔ should succeed even when it fails to delete the uploaded archive + ✔ should throw an error if one is thrown while uploading a local source + checkIfInstanceIdAlreadyExists + ✔ should return false if no instance with that name exists + ✔ should return true if an instance with that name exists + ✔ should throw if it gets an unexpected error response from getInstance + getFirebaseProjectParams + ✔ should not call prodution when using a demo- project in emulator mode + ✔ should return real values for non 'demo-' projects + getNextVersionByStage + ✔ should return expected stages and versions + ✔ should ignore unknown stages and different prerelease format + unpackExtensionState + ✔ should return correct published state + ✔ should return correct uploaded state + ✔ should return correct deprecated state + ✔ should return correct suspended state + ✔ should return correct prerelease state + canonicalizeRefInput + ✔ should do nothing to a valid ref + ✔ should infer latest version + ✔ should infer publisher name as firebase + ✔ should infer publisher name as firebase and also infer latest as version + + listExtensions + ✔ should return an empty array if no extensions have been installed + ✔ should return a sorted array of extension instances + + localHelper + getLocalExtensionSpec + ✔ should return a spec when extension.yaml is present + ✔ should populate preinstallContent when PREINSTALL.md is present + ✔ should return a nice error if there is no extension.yaml + with an invalid YAML file + ✔ should return a rejected promise with a useful error if extension.yaml is invalid + other YAML errors + ✔ should rethrow normal errors + isLocalExtension + ✔ should return true if a file exists there + ✔ should return false if a file doesn't exist there + + manifest + instanceExists + ✔ should return true for an existing instance + ✔ should return false for a non-existing instance + getInstanceTarget + ✔ should return the correct source for a local instance + ✔ should return the correct source for an instance with ref + ✔ should throw when looking for a non-existing instance + getInstanceRef + ✔ should return the correct ref for an existing instance + ✔ should throw when looking for a non-existing instance + ✔ should throw when looking for a instance with local source + removeFromManifest + ✔ should remove from firebase.json and remove .env file + writeToManifest + ✔ should write to both firebase.json and env files + ✔ should write to env files in stable, alphabetical by key order + ✔ should write events-related env vars + ✔ should overwrite when user chooses to + ✔ should not write empty values + writeLocalSecrets + ✔ should write all secret params that have local values + ✔ should write only secret with local values + ✔ should write only local values that are ParamType.SECRET + ✔ should not write the file if there's no matching params + readParams + ✔ should read from generic .env file + ✔ should read from project id .env file + ✔ should read from project number .env file + ✔ should read from an alias .env file + ✔ should prefer values from project specific env files + + metricsUtil + parseBucket + ✔ should parse a bucket based on the higher bound value + buildMetricsTableRow + ✔ shows decreasing instance count properly + ✔ shows decreasing instance count properly + parseTimeseriesResponse + ✔ should parse TimeSeriesResponse into list of BucketedMetrics + + paramHelper + getBaseParamBindings + ✔ should extract the baseValue param bindings + buildBindingOptionsWithBaseValue + ✔ should build given baseValue values + getParams + ✔ should prompt the user for params + getParamsWithCurrentValuesAsDefaults + ✔ should change existing defaults to the current state and leave other values unchanged + promptForNewParams + ✔ should prompt the user for any params in the new spec that are not in the current one + ✔ should prompt for params that are not currently populated + ✔ should not prompt the user for params that did not change type or param + ✔ should populate the spec with the default value if it is returned by prompt + ✔ shouldn't prompt if there are no new params + ✔ should exit if a prompt fails + + provisioningHelper + getUsedProducts + ✔ returns empty array when nothing is used + ✔ returns STORAGE when Storage API is used + ✔ returns STORAGE when Storage Role is used + ✔ returns STORAGE when Storage trigger is used + ✔ returns AUTH when Authentication API is used + ✔ returns AUTH when Authentication Role is used + ✔ returns AUTH when Auth trigger is used + checkProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no firebase storage buckets + ✔ fails provisioning check storage when no auth is not provisioned + bulkCheckProductsProvisioned + ✔ passes provisioning check status when nothing is used + ✔ passes provisioning check when all is provisioned + ✔ checks all products for multiple versions + ✔ fails provisioning check storage when default bucket is not linked + ✔ fails provisioning check storage when no auth is not provisioned + + createExtensionVersionFromGitHubSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + createExtensionVersionFromLocalSource + ✔ should make a POST call to the correct endpoint, and then poll on the returned operation + ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response + ✔ stop polling and throw if the operation call throws an unexpected error + ✔ should throw an error for an invalid ref + + getExtension + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + getExtensionVersion + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + ✔ should throw an error for an invalid ref + + listExtensions + ✔ should return a list of published extensions + ✔ should return a list of all extensions + ✔ should query for more extensions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + + listExtensionVersions + ✔ should return a list of published extension versions + ✔ should send filter query param + ✔ should return a list of all extension versions + ✔ should query for more extension versions if the response has a next_page_token + ✔ should throw FirebaseError if any call returns an error + ✔ should throw an error for an invalid ref + + getPublisherProfile + ✔ should make a GET call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + registerPublisherProfile + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + deprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + undeprecateExtensionVersion + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + secretsUtils + getManagedSecrets + ✔ only returns secrets that have labels set + + tos + ✔ should return the latest publisher TOS is it has already been accepted + getAppDeveloperTOSStatus + ✔ should get app developer TOS + getPublisherTOS + ✔ should get publisher TOS + acceptAppDeveloperTOS + ✔ should accept app dev TOS with no instance + ✔ should accept app dev TOS with an instance + acceptPublisherTOS + ✔ should accept publisher TOS + acceptLatestAppDeveloperTOS + ✔ should prompt to accept the latest app dev TOS if it has not been accepted + ✔ should not prompt for the latest app dev TOS if it has already been accepted + ✔ should accept the TOS once per instance + acceptLatestPublisherTOS + ✔ should prompt to accept the latest publisher TOS if it has not been accepted + + updateHelper + updateFromLocalSource + ✔ should return the correct source name for a valid local source + ✔ should throw an error for an invalid source + updateFromUrlSource + ✔ should return the correct source name for a valid url source + ✔ should throw an error for an invalid source + + inferUpdateSource + ✔ should infer update source from ref without version + ✔ should infer update source from ref with just version + ✔ should infer update source from ref and extension name + ✔ should infer update source if it is a ref distinct from the input ref + + getExistingSourceOrigin + ✔ should return published extension as source origin + ✔ should return local extension as source origin + + extensions utils + formatTimestamp + ✔ should format timestamp correctly + + displayWarningsForDeploy + ✔ should not warn if published + ✔ should not warn if not published + + fetchWebSetup module + fetchWebSetup + ✔ should fetch the web app config + ✔ should store the fetched config + ✔ should throw an error if the request fails + ✔ should return a fake config for a demo project id + getCachedWebSetup + ✔ should return no config if none is cached + ✔ should return a stored config + + filterTargets + ✔ should leave targets alone if no filtering is specified + ✔ should filter targets from --only + ✔ should filter out targets with --except + + firebaseConfigValidate + ✔ should accept a basic, valid config + ✔ should report an extra top-level field + ✔ should report a missing required field + ✔ should report a field with an incorrect type + + encodeFirestoreValue + ✔ should encode known types + ✔ should throw an error with unknown types + + IndexValidation + ✔ should accept a valid v1beta2 index spec + ✔ should not change a valid v1beta2 index spec after upgrade + ✔ should accept an empty spec + ✔ should accept a valid v1beta1 index spec after upgrade + ✔ should reject an incomplete index spec + ✔ should reject an overspecified index spec + + IndexSpecMatching + ✔ should identify a positive index spec match + ✔ should identify a negative index spec match + ✔ should identify a positive field spec match + ✔ should identify a positive field spec match with ttl specified as false + ✔ should identify a positive ttl field spec match + ✔ should identify a negative ttl field spec match + ✔ should match a field spec with all indexes excluded + ✔ should match a field spec with only ttl + ✔ should identify a negative field spec match + ✔ should identify a negative field spec match with ttl as false + + IndexSorting + ✔ should be able to handle empty arrays + ✔ should correctly sort an array of Spec indexes + ✔ should correcty sort an array of Spec field overrides + ✔ should sort ttl true to be last in an array of Spec field overrides + ✔ should correctly sort an array of API indexes + ✔ should correctly sort an array of API field overrides + + IndexNameParsing + ✔ should parse an index name correctly + ✔ should parse a field name correctly + ✔ should parse an index name from a named database correctly + ✔ should parse a field name from a named database correctly + + Angular + discovery + ✔ should find an Angular app + + Astro + discovery + ✔ should find a static Astro app + ✔ should find an Astro SSR app + ɵcodegenPublicDirectory + ✔ should copy over a static Astro app + ✔ should copy over an Astro SSR app + ɵcodegenFunctionsDirectory + ✔ should copy over the cloud function + build + ✔ should build an Astro SSR app + ✔ should fail to build an Astro SSR app w/wrong adapter + ✔ should build an Astro static app + getDevModeHandle + 🚀 astro v2.2.2 started in 64ms + + ┃ Local http://localhost:3000/ + ┃ Network use --host to expose + + ✔ should resolve with dev server output + + RepositoryFileSystem + exists + ✔ should return true if file exists in the directory + ✔ should return false if file does not exist in the directory + read + ✔ should read and return the contents of the file + + frameworkMatcher + frameworkMatcher + ✔ should return express FrameworkSpec after analysing express application + removeEmbededFrameworks + ✔ should return frameworks after removing embeded frameworks + filterFrameworksWithFiles + ✔ should return frameworks having all the required files + filterFrameworksWithDependencies + ✔ should return frameworks having required dependencies with in the project dependencies + + DockerfileBuilder + from + ✔ should add a FROM instruction to the Dockerfile + ✔ should add a FROM instruction to the Dockerfile without a name + fromLastStage + ✔ should add a FROM instruction to the Dockerfile using the last stage name + tempFrom + ✔ should add a FROM instruction without updating last stage + workdir + ✔ should add a WORKDIR instruction to the Dockerfile + run + ✔ should add a RUN instruction to the Dockerfile + cmd + ✔ should add a CMD instruction to the Dockerfile + copyForFirebase + ✔ should add a COPY instruction to the Dockerfile + copyFrom + ✔ should add a COPY instruction to the Dockerfile + env + ✔ should add an ENV instruction to the Dockerfile + envs + ✔ should add multiple ENV instructions to the Dockerfile + + genHookScript + ✔ generates executable script from anonymous functions + ✔ generates executable script from a named function + ✔ generates executable script from an object method + + Flutter + discovery + ✔ should discover + ✔ should not discover, if missing files + ✔ should not discovery, not flutter + ɵcodegenPublicDirectory + ✔ should copy over the web dir + build + ✔ should build + init + ✔ should create a new project + + Flutter utils + assertFlutterCliExists + ✔ should return void, if !status + + Next.js utils + ✔ should allow supported rewrites + cleanEscapedChars + ✔ should clean escaped chars + isRedirectSupportedByFirebase + ✔ should allow supported redirects + isHeaderSupportedByFirebase + ✔ should allow supported headers + getNextjsRewritesToUse + ✔ should use only beforeFiles + ✔ should return all rewrites if in array format + usesAppDirRouter + ✔ should return false when app dir doesn't exist + ✔ should return true when app dir does exist + usesNextImage + ✔ should return true when export marker has isNextImageImported + ✔ should return false when export marker has !isNextImageImported + hasUnoptimizedImage + ✔ should return true when images manfiest indicates unoptimized + ✔ should return true when images manfiest indicates !unoptimized + isUsingMiddleware + ✔ should return true if using middleware in development + ✔ should return false if not using middleware in development + ✔ should return true if using middleware in production + ✔ should return false if not using middleware in production + isUsingImageOptimization + ✔ should return true if images optimization is used + ✔ should return false if isNextImageImported is false + ✔ should return false if `unoptimized` option is used + isUsingAppDirectory + ✔ should return true if app-path-routes-manifest.json exists + ✔ should return false if app-path-routes-manifest.json did not exist + cleanCustomRouteI18n + ✔ should remove Next.js i18n prefix + allDependencyNames + ✔ should return empty on stopping conditions + ✔ should return expected dependency names + getMiddlewareMatcherRegexes + ✔ should return regexes when using version 1 + ✔ should return empty array when using version 1 but not using middleware + ✔ should return regexes when using version 2 + ✔ should return empty array when using version 2 but not using middleware + getNonStaticRoutes + ✔ should get non-static routes + getNonStaticServerComponents + ✔ should get non-static server components + getHeadersFromMetaFiles + ✔ should get headers from meta files + + Nuxt 2 utils + nuxtAppDiscovery + ✔ should find a Nuxt 2 app + ✔ should find a Nuxt 3 app + getDevModeHandle +Nuxi 3.0.0 + + WARN Changing NODE_ENV from production to development, to avoid unintended behavior. + + Nuxt 3.0.0 with Nitro 1.0.0 + + > Local: http://localhost:3000/ + > Network: http://0.0.0.0:3000/ + > Network: http://[some:ipv6::::::]:3000/ + > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output + + Frameworks utils + getNodeModuleBin + ✔ should return expected tsc path (255ms) + ✔ should throw when npm root not found (258ms) + ✔ should throw when executable not found (250ms) + isUrl + ✔ should identify http URL + ✔ should identify https URL + ✔ should ignore URL within path + ✔ should ignore path starting with http but without protocol + ✔ should ignore path starting with https but without protocol + warnIfCustomBuildScript + ✔ should not print warning when a default build script is found. + ✔ should print warning when a custom build script is found. + conjoinOptions + ✔ should return undefined if there's no options + ✔ should return option if there's only one + ✔ should return options without separator if there's two options + ✔ should return options with default conjunction and default separator + ✔ should return options with custom separator + ✔ should return options with custom conjunction + + fsAsync + readdirRecursive + ✔ can recurse directories + ✔ can ignore directories + ✔ supports blob rules + ✔ should support negation rules + + fsutils + fileExistsSync + ✔ should return true if the file exists + ✔ should return false if the file does not exist + ✔ should return false if the path is a directory + dirExistsSync + ✔ should return true if the directory exists + ✔ should return false if the directory does not exist + ✔ should return false if the path is a file + + functional + ✔ zipIn + ✔ assertExhaustive + flatten + ✔ can iterate an empty object + ✔ can iterate an object that's already flat + ✔ Gets the right type for flattening arrays + ✔ can handle nested objects + ✔ can handle objects with array values + ✔ can iterate an empty array + ✔ can noop arrays + ✔ can flatten + reduceFlat + ✔ can noop + ✔ can flatten + zip + ✔ can handle an empty array + ✔ can zip + ✔ throws on length mismatch + partition + ✔ should split an array into true and false + ✔ can handle an empty array + partitionRecord + ✔ should split a record into true and false + ✔ can handle an empty record + + ensureTargeted + ✔ does nothing if 'functions' is included + ✔ does nothing if the codebase is targeted + ✔ does nothing if the function is targeted + ✔ adds the codebase if missing and no id is provided + ✔ adds the function if missing + + functions/env + parse + ✔ should parse values with trailing spaces + ✔ should parse values with trailing spaces (single quotes) + ✔ should parse values with trailing spaces (double quotes) + ✔ should parse double quoted, multi-line values + ✔ should parse many double quoted values + ✔ should parse many single quoted values + ✔ should parse mix of double and single quoted values + ✔ should parse double quoted with escaped newlines + ✔ should parse escape sequences in order, from start to end + ✔ should parse double quoted with multiple escaped newlines + ✔ should parse double quoted with multiple escaped horizontal tabs + ✔ should parse double quoted with multiple escaped vertical tabs + ✔ should parse double quoted with multiple escaped carriage returns + ✔ should leave single quotes when double quoted + ✔ should leave double quotes when single quoted + ✔ should unescape escape characters for double quoted values + ✔ should leave escape characters intact for single quoted values + ✔ should leave escape characters intact for unquoted values + ✔ should parse empty value + ✔ should parse keys with leading spaces + ✔ should parse values with trailing spaces (unquoted) + ✔ should parse values with trailing spaces (single quoted) + ✔ should parse values with trailing spaces (double quoted) + ✔ should throw away unquoted values following # + ✔ should keep values following # in singqle quotes + ✔ should keep values following # in double quotes + ✔ should ignore leading/trailing spaces before the separator (unquoted) + ✔ should ignore leading/trailing spaces before the separator (single quotes) + ✔ should ignore leading/trailing spaces before the separator (double quotes) + ✔ should handle empty values + ✔ should handle quoted values after a newline + ✔ should ignore comments + ✔ should ignore empty lines + ✔ should catch invalid lines + validateKey + ✔ accepts valid keys + ✔ throws error given invalid keys + ✔ throws error given reserved keys + ✔ throws error given keys with a reserved prefix + writeUserEnvs + ✔ never affects the filesystem if the list of keys to write is empty + ✔ touches .env.projectId if it doesn't already exist + ✔ touches .env.local if it doesn't already exist in emulator mode + ✔ throws if asked to write a key that already exists in .env.projectId + ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in any .env + ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode + ✔ throws if asked to write a key that already exists in .env.local, in emulator mode + ✔ throws if asked to write a key that fails key format validation + ✔ writes the specified key to a .env.projectId that it created + ✔ writes the specified key to a .env.projectId that already existed + ✔ writes multiple keys at once + ✔ escapes special characters so that parse() can reverse them + ✔ shouldn't write anything if any of the keys fails key format validation + loadUserEnvs + ✔ loads nothing if .env files are missing + ✔ loads envs from .env file + ✔ loads envs from .env file, ignoring comments + ✔ loads envs from .env. file + ✔ loads envs from .env. file + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs, preferring ones from .env. + ✔ loads envs, preferring ones from .env. for emulators too + ✔ loads envs ignoring .env.local + ✔ loads envs, preferring .env.local for the emulator + ✔ throws an error if both .env. and .env. exists + ✔ throws an error .env file is invalid + ✔ throws an error .env file contains invalid keys + ✔ throws an error .env file contains reserved keys + + functionsLog + getApiFilter + ✔ should return base api filter for v1&v2 functions + ✔ should return list api filter for v1&v2 functions + logEntries + ✔ should log no entries + ✔ should log entries + + projectConfig + normalize + ✔ normalizes singleton config + ✔ normalizes array config + ✔ throws error if given empty config + validate + ✔ passes validation for simple config + ✔ fails validation given config w/o source + ✔ fails validation given config w/ empty source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given codebase name with capital letters + ✔ fails validation given codebase name with invalid characters + ✔ fails validation given long codebase name + normalizeAndValidate + ✔ returns normalized config for singleton config + ✔ returns normalized config for multi-resource config + ✔ fails validation given singleton config w/o source + ✔ fails validation given singleton config w empty source + ✔ fails validation given multi-resource config w/o source + ✔ fails validation given config w/ duplicate source + ✔ fails validation given config w/ duplicate codebase + + functions-config-export + getAllProjects + ✔ should include projectId from the options + ✔ should include project and its alias from firebaserc + convertKey + ✔ should converts valid config key + ✔ should throw error if conversion is invalid + ✔ should use prefix to fix invalid config keys + ✔ should throw error if prefix is invalid + configToEnv + ✔ should convert valid functions config + ✔ should collect errors for invalid conversions + ✔ should use prefix to fix invalid keys + toDotenvFormat + ✔ should produce valid dotenv file with keys + ✔ should preserve newline characters + generateDotenvFilename + ✔ should generate dotenv filename using project alias + ✔ should generate dotenv filename using project id if alias doesn't exist + + functions/secret + ensureValidKey + ✔ returns the original key if it follows convention + ✔ returns the transformed key (with warning) if with dashes + ✔ returns the transformed key (with warning) if with periods + ✔ returns the transformed key (with warning) if with lower cases + ✔ returns the transformed key (with warning) if camelCased + ✔ throws error if given non-conventional key w/ forced option + ✔ throws error if given reserved key + ensureSecret + ✔ returns existing secret if we have one + ✔ prompt user to have Firebase manage the secret if not managed by Firebase + ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase + ✔ creates a new secret if it doesn't exists + ✔ throws if it cannot reach Secret Manager + of + ✔ returns empty list given empty list + ✔ collects all secret environment variables + getSecretVersions + ✔ returns object mapping secrets and their versions + pruneSecrets + ✔ returns nothing if unused + ✔ returns all secrets given no endpoints + ✔ does not include secret version in use + ✔ resolves 'latest' secrets and properly prunes it + inUse + ✔ returns true if secret is in use + ✔ returns true if secret is in use by project number + ✔ returns false if secret is not in use + ✔ returns false if secret of same name from another project is in use + pruneAndDestroySecrets + ✔ destroys pruned secrets + ✔ collects errors + updateEndpointsSecret + ✔ returns early if secret is not in use + ✔ updates function with the version of the given secret + + config.parseSetArgs + ✔ should throw if a reserved namespace is used + ✔ should throw if a malformed arg is used + ✔ should parse args into correct config and variable IDs + + config.parseUnsetArgs + ✔ should throw if a reserved namespace is used + ✔ should parse args into correct config and variable IDs + + cloudfunctions + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ detects task queue functions + ✔ detects beforeCreate blocking functions + ✔ detects beforeSignIn blocking functions + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should translate event triggers + ✔ should translate scheduled triggers + ✔ should translate task queue triggers + ✔ should translate beforeCreate blocking triggers + ✔ should translate beforeSignIn blocking triggers + ✔ should copy optional fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + listFunctions + ✔ should pass back an error with the correct status + + cloudfunctionsv2 + megabytes + ✔ Should handle decimal SI units + ✔ Should handle binary SI units + ✔ Should handle no unit + functionFromEndpoint + ✔ should guard against version mixing + ✔ should copy a minimal function + ✔ should copy trival fields + ✔ should calculate non-trivial fields + ✔ should correctly convert CPU and concurrency values + ✔ should export codebase as label + ✔ should export hash as label + endpointFromFunction + ✔ should copy a minimal version + ✔ should copy run service IDs + ✔ should translate event triggers + ✔ should translate custom event triggers + ✔ should translate task queue functions + ✔ should translate beforeCreate blocking functions + ✔ should translate beforeSignIn blocking functions + ✔ should copy optional fields + ✔ should transform fields + ✔ should derive codebase from labels + ✔ should derive hash from labels + ✔ should convert function without serviceConfig + listFunctions + ✔ should pass back an error with the correct status + + queryTimeSeries + ✔ should make a POST call to the correct endpoint + ✔ should throw a FirebaseError if the endpoint returns an error response + + cloudscheduler + createOrUpdateJob + ✔ should create a job if none exists + ✔ should do nothing if a functionally identical job exists + ✔ should do nothing if a job exists with superset retry config. + ✔ should update if a job exists with the same name and a different schedule + ✔ should update if a job exists with the same name but a different timeZone + ✔ should update if a job exists with the same name but a different retry config + ✔ should error and exit if cloud resource location is not set + ✔ should error and exit if cloud scheduler create request fail + jobFromEndpoint + ✔ should copy minimal fields for v1 endpoints + ✔ should copy minimal fields for v2 endpoints + ✔ should copy optional fields for v1 endpoints + ✔ should copy optional fields for v2 endpoints + + CloudTasks + queueFromEndpoint + ✔ handles minimal endpoints + ✔ handles complex endpoints + triggerFromQueue + ✔ handles queue with default settings + ✔ handles queue with custom configs + upsertEndpoint + ✔ accepts a matching queue + ✔ updates a non-matching queue + ✔ purges a disabled queue + setEnqueuer + ✔ can blind-write + ✔ preserves other roles + ✔ noops existing matches + ✔ can insert an enqueuer binding + ✔ can resolve conflicts + + iam + testIamPermissions + ✔ should pass if we have all permissions + ✔ should fail if we don't have all permissions + + proto + ✔ pruneUndefindes + duration + ✔ should convert from seconds to duration + ✔ should convert from duration to seconds + copyIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support variadic params + renameIfPresent + ✔ should copy present fields + ✔ should not copy missing fields + ✔ should support transformations + ✔ should support transformations with renames + fieldMasks + ✔ should copy simple fields + ✔ should handle empty values + ✔ should nest into objects + ✔ should include empty objects + ✔ should support map types + getInvokerMembers + ✔ should return empty array with private invoker + ✔ should return allUsers with public invoker + ✔ should return formatted service accounts with invoker array + formatServiceAccount + ✔ should throw error on empty service account string + ✔ should throw error on badly formed service account string + ✔ should return formatted service account from invoker ending with @ + ✔ should return formatted service account from invoker with full service account + + run + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the setting the IAM policy fails + ✔ should set a private policy on a function + ✔ should set a public policy on a function + ✔ should set the policy with a set of invokers with active policies + setInvokerUpdate + setInvokerCreate + ✔ should reject on emtpy invoker array + ✔ should reject if the getting the IAM policy fails + ✔ should reject if the setting the IAM policy fails + ✔ should set a basic policy on a function without any polices + ✔ should set the policy with private invoker with active policies + ✔ should set the policy with a set of invokers with active policies + ✔ should not set the policy if the set of invokers is the same as the current invokers + updateService + ✔ handles noops immediately + ✔ loops on ready status + serviceIsResolved + ✔ returns false if the observed generation isn't the metageneration + ✔ returns false if the status is not ready + ✔ throws if we have an failed status + ✔ returns true if resolved + + secretManager + parseSecretResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ parse secret version resource name + parseSecretVersionResourceName + ✔ parses valid secret resource name + ✔ throws given invalid resource name + ✔ throws given incomplete resource name + ✔ throws given secret resource name + ensureServiceAgentRole + ✔ adds new binding for each member + ✔ adds bindings only for missing members + ✔ keeps bindings that already exists + ✔ does nothing if the binding already exists + + hosting + getChannel + ✔ should make the API request for a channel + ✔ should return null if there's no channel + ✔ should throw an error if the server returns an error + listChannels + ✔ should make a single API requests to list a small number of channels + ✔ should make multiple API requests to list channels + ✔ should return an error if there's no channel + ✔ should throw an error if the server returns an error + createChannel + ✔ should make the API request to create a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + updateChannelTtl + ✔ should make the API request to update a channel + ✔ should let us customize the TTL + ✔ should throw an error if the server returns an error + deleteChannel + ✔ should make the API request to delete a channel + ✔ should throw an error if the server returns an error + createVersion + ✔ should make the API requests to create a version + ✔ should throw an error if the server returns an error + updateVersion + ✔ should make the API requests to update a version + ✔ should throw an error if the server returns an error + listVersions + ✔ returns a single page of versions + ✔ paginates through many versions + ✔ handles errors + cloneVersion + ✔ should make the API requests to clone a version + ✔ should throw an error if the server returns an error + createRelease + ✔ should make the API request to create a release + ✔ should include a message, if provided + ✔ should throw an error if the server returns an error + getSite + ✔ should make the API request for a channel + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + listSites + ✔ should make a single API requests to list a small number of sites + ✔ should make multiple API requests to list sites + ✔ should return an error if there's no site + ✔ should throw an error if the server returns an error + createSite + ✔ should make the API request to create a channel + ✔ should throw an error if the server returns an error + updateSite + ✔ should make the API request to update a site + ✔ should throw an error if the server returns an error + deleteSite + ✔ should make the API request to delete a site + ✔ should throw an error if the server returns an error + getCleanDomains + ✔ should return the list of expected auth domains after syncing + getSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + ✔ should throw an error if the server returns an error + getAllSiteDomains + ✔ should get the site domains + ✔ should throw an error if the site doesn't exist + + normalizeName + ✔ should handle the normalization of happy-path + ✔ should handle the normalization of feature/branch + ✔ should handle the normalization of featuRe/Branch + ✔ should handle the normalization of what/are:you_thinking + ✔ should handle the normalization of happyBranch + ✔ should handle the normalization of happy:branch + ✔ should handle the normalization of happy_branch + ✔ should handle the normalization of happy#branch + + cloudRunProxy + ✔ should error when not provided a valid Cloud Run service ID + ✔ should error when the Cloud Run service doesn't exist + ✔ should error when the Cloud Run service doesn't exist + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should pass on provided headers to the origin + ✔ should not send the `host` header if it's provided + ✔ should resolve to a live version in another region + ✔ should cache calls to look up Cloud Run service URLs + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service + ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service + + config + ✔ normalize + extract + ✔ should handle no hosting config + ✔ should fail if both site and target are specified + ✔ should always return an array + ✔ should support legacy method of specifying site + resolveTargets + ✔ should not modify the config + ✔ should add sites when found + ✔ should prohibit multiple sites + filterOnly + ✔ should be able to parse a normal hosting config, specifying the default site + ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site + ✔ should be able to parse a normal hosting config with a target + ✔ should be able to parse a hosting config with multiple targets, specifying one + ✔ should be able to parse a hosting config with multiple targets, specifying all hosting + ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target + ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target + ✔ should be able to parse a hosting config without an only string + ✔ should be able to parse a hosting config with a non-hosting only flag + with an except parameter, resolving targets + ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site + ✔ should be able to parse a normal hosting config with a target, omitting the target + ✔ should be able to parse a hosting config with multiple targets, omitting one + ✔ should be able to parse a hosting config with multiple targets, omitting all hosting + ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target + ✔ should be able to parse a hosting config with no excpet string + ✔ should be able to parse a hosting config with a non-hosting except string + validate + ✔ should error out if there is no public directory but a 'destination' rewrite + ✔ should error out if there is no public directory and an i18n with root + ✔ should error out if there is a public direcotry and an i18n with no root + ✔ should error out if region is set and function is unset + ✔ should error out if region is set and functions is the new form + ✔ should pass with public and nothing else + ✔ should pass with no public but a function rewrite + ✔ should pass with no public but a run rewrite + ✔ should pass with no public but a redirect + + calculateChannelExpireTTL + ✔ should be able to parse time 30d + ✔ should be able to parse time 1d + ✔ should be able to parse time 2d + ✔ should be able to parse time 2h + ✔ should be able to parse time 56m + ✔ should be able to parse time 1.5d + ✔ should be able to parse time 2x + ✔ should be able to parse time 2dd + ✔ should be able to parse time 0.5m + ✔ should be able to parse time undefined + ✔ should throw if greater than 30d + + functionsProxy + ✔ should resolve a function returns middleware that proxies to the live version + ✔ should resolve a function returns middleware that proxies to the live version in another region + ✔ should resolve a function that returns middleware that proxies to a local version + ✔ should resolve a function that returns middleware that proxies to a local version in another region + ✔ should maintain the location header as returned by the function + ✔ should allow location headers that wouldn't redirect to itself + ✔ should proxy a request body on a POST request + ✔ should proxy with a query string + ✔ should return 3xx responses directly + ✔ should pass through multiple set-cookie headers + ✔ should pass through normal 404 errors + ✔ should do nothing on 404 errors with x-cascade + ✔ should remove cookies on non-private cached responses + ✔ should add required Vary headers to the response + ✔ should respond with a 500 error if an error occurs calling the function + ✔ should respond with a 504 error if a timeout error occurs calling the function + ✔ should respond with a 504 error if a sockettimeout error occurs calling the function + + initMiddleware + ✔ should be able to proxy a basic sdk request + ✔ should be able to proxy with the correct accept-encoding + ✔ should provide the init.js file + ✔ should provide the emulator init.js file when appropriate + ✔ should provide the firebase config (init.json) + ✔ should pass (call next) if the sdk file doesn't exit + ✔ should ignore any other request path (200) + ✔ should ignore any other request path (403) + when dealing with compressed data + ✔ should return compressed data if it is returned compressed + + runTags + gcTagsForServices + ✔ leaves only active revisions + setRewriteTags + ✔ preserves existing tags and other types of rewrites + ✔ replaces tags in rewrites with new/verified tags + ✔ garbage collects if necessary + ensureLatestRevisionTagged + ✔ Reuses existing tag names + ✔ Adds new tags as necessary + + firestore + doSetup + ✔ should require access, set up rules and indices, ensure cloud resource location set + ✔ should error when the firestore API is not enabled + ✔ should error when firestore is in the wrong mode + + functions + doSetup + with an uninitialized Firebase project repository + ✔ creates a new javascript codebase with the correct configuration (118ms) + ✔ creates a new typescript codebase with the correct configuration (113ms) + with an existing functions codebase in Firebase repository + ✔ initializes a new codebase + ✔ reinitializes an existing codebase + + project + doSetup + with "Use an existing project" option + ✔ should set up the correct properties in the project + with "Create a new project" option + ✔ should create a new project and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Add Firebase resources to GCP project" option + ✔ should add firebase resources and set up the correct properties + ✔ should throw if project ID is empty after prompt + with "Don't set up a default project" option + ✔ should set up the correct properties when not choosing a project + with defined .firebaserc file + ✔ should not prompt + ✔ should set project location even if .firebaserc is already set up + + storage + doSetup + ✔ should set up the correct properties in the project + ✔ should error when cloud resource location is not set + + listFiles + ✔ should ignore firebase-debug.log, specified ignores, and nothing else + ✔ should allow us to not specify additional ignores + + localFunction._constructAuth + #_constructAuth + ✔ warn if opts.auth and opts.authType are conflicting + ✔ construct the correct auth for admin users + ✔ construct the correct auth for unauthenticated users + ✔ construct the correct auth for authenticated users + ✔ leaves auth untouched if it already follows wire format + localFunction._makeFirestoreValue + ✔ returns {} when there is no data + ✔ throws error when data is not key-value pairs + + App management + getAppPlatform + ✔ should return the iOS platform + ✔ should return the Android platform + ✔ should return the Web platform + ✔ should return the ANY platform + ✔ should throw if the platform is unknown + createIosApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createAndroidApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + createWebApp + ✔ should resolve with app data if it succeeds + ✔ should reject if app creation api call fails + ✔ should reject if polling throws error + listFirebaseApps + ✔ should resolve with app list if it succeeds with only 1 api call + ✔ should resolve with iOS app list + ✔ should resolve with Android app list + ✔ should resolve with Web app list + ✔ should concatenate pages to get app list if it succeeds + ✔ should reject if the first api call fails + ✔ should rejects if error is thrown in subsequence api call + ✔ should reject if the list iOS apps fails + ✔ should reject if the list Android apps fails + ✔ should reject if the list Web apps fails + getAppConfigFile + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + getAppConfig + ✔ should resolve with iOS app configuration if it succeeds + ✔ should resolve with Android app configuration if it succeeds + ✔ should resolve with Web app configuration if it succeeds + ✔ should reject if api request fails + + Database management + getDatabaseInstanceDetails + ✔ should resolve with DatabaseInstance if API call succeeds + ✔ should reject if API call fails + createInstance + ✔ should resolve with new DatabaseInstance if API call succeeds + ✔ should reject if API call fails + checkInstanceNameAvailable + ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds + ✔ should resolve with suggested instance names if the API call fails with suggestions + ✔ should reject if API call fails without suggestions + listDatabaseInstances + ✔ should resolve with instance list if it succeeds with only 1 api call + ✔ should resolve with specific location + ✔ should concatenate pages to get instances list if it succeeds + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + + Project management + Interactive flows + getOrPromptProject + ✔ should get project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + ✔ should get the correct project info when --project is supplied + ✔ should throw error when getFirebaseProject throw an error + promptAvailableProjectId + ✔ should select project from list if it is able to list all projects + ✔ should prompt project id if it is not able to list all projects + ✔ should throw if there's no project + API methods + createCloudProject + ✔ should resolve with cloud project data if it succeeds + ✔ should reject if Cloud project creation fails + ✔ should reject if Cloud project creation polling throws error + addFirebaseToCloudProject + ✔ should resolve with Firebase project data if it succeeds + ✔ should reject if add Firebase api call fails + ✔ should reject if polling add Firebase operation throws error + getAvailableCloudProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + getFirebaseProjectPage + ✔ should resolve with a project page if it succeeds (no input token) + ✔ should resolve with a project page if it succeeds (with input token) + ✔ should resolve with a project page if it succeeds with no next page token + ✔ should reject if the api call fails + listFirebaseProjects + ✔ should resolve with project list if it succeeds with only 1 api call + ✔ should concatenate pages to get project list if it succeeds with multiple api calls + ✔ should reject if the first api call fails + ✔ should reject if error is thrown in subsequent api call + getFirebaseProject + ✔ should resolve with project information if it succeeds + ✔ should reject if the api call fails + + metaprogramming + ✔ can calcluate recursive keys + ✔ can detect recursive elems + ✔ Can deep pick + ✔ can deep omit + + OperationPoller + poll + ✔ should return result with response field if polling succeeds + ✔ should return result with error field if polling operation returns failure response + ✔ should return result with error field if api call rejects with unrecoverable error + ✔ should retry polling if http request responds with 500 or 503 status code (70ms) + ✔ should retry polling until the LRO is done (74ms) + ✔ should reject with TimeoutError when timed out after failed retries (202ms) +[ + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', + 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' +] + ✔ should call onPoll each time the operation is polled + + profilerReport + ✔ should correctly generate a report + ✔ should format numbers correctly + ✔ should not collapse paths if not needed + ✔ should collapse paths to $wildcard + ✔ should not collapse paths with --no-collapse + ✔ should collapse paths recursively + ✔ should extract the correct path index + ✔ should extract the correct value index + + getProjectId + ✔ should prefer projectId, falling back to project + + needProjectId + ✔ should throw when no project provided and no aliases available + ✔ should throw and mention aliases when they are available + ✔ should return projectId, falling back to project + + needProjectNumber + ✔ should return the project number from options, if present + ✔ should fetch the project number if necessary + ✔ should reject with an error on an error + + getAliases + ✔ should return the aliases for a projectId + ✔ should return an empty array if there are no aliases in rc + + prompt + prompt + ✔ should error if questions are asked in nonInteractive environment + ✔ should utilize inquirer to prompt for the questions + ✔ should add the new values to the options object + promptOnce + ✔ should provide a name if one is not provided + ✔ should return the value for the given name + ✔ should handle names with .'s + + RC + .load + ✔ should load from nearest project directory + ✔ should be an empty object when not in project dir + ✔ should not throw up on invalid json + ✔ should load from the right directory when --config is specified + instance methods + #addProjectAlias + ✔ should set a value in projects. + #removeProjectAlias + ✔ should remove an already set value in projects. + #hasProjects + ✔ should be true if project aliases are set, false if not + #allTargets + ✔ should return all targets of all types for a project + #targets + ✔ should return all targets for specified project and type + ✔ should return an empty object for missing data + #target + ✔ should return all resources for a specified target + ✔ should return an empty array if nothing is found + #unsetTargetResource + ✔ should remove a resource from a target + ✔ should no-op if the resource is not in the target + #applyTarget + ✔ should error for an unrecognized target type + ✔ should coerce a string argument into an array + ✔ should add all resources to the specified target + ✔ should remove a resource from a different target + ✔ should return a list of resources that changed targets + #removeTarget + ✔ should remove a the target for a specific resource and return its name + ✔ should return null if not present + #clearTarget + ✔ should clear an existing target by name and return true + ✔ should return false for a non-existent target + + Remote Config GET + getTemplate + ✔ should return the latest template + ✔ should return the correct version of the template if version is specified + ✔ should return a correctly parsed entry value with one parameter + ✔ should return a correctly parsed entry value with two parameters + ✔ should reject if the api call fails + + RemoteConfig Rollback + rollbackCurrentVersion + ✔ should return a rollback to the version number specified + - should reject invalid rollback version number + - should return a rollback to the previous version + ✔ should reject if the api call fails + + RemoteConfig ListVersions + getVersionTemplate + ✔ should return the list of versions up to the limit + ✔ should return all the versions when the limit is 0 + ✔ should return with default 10 versions when no limit is set + ✔ should reject if the api call fails + + requireConfig + ✔ should resolve if config exists + ✔ should fail if config does not exist + ✔ should return the existing configError if one is set + + RulesDeploy + addFile + ✔ should successfully add a file that exists + ✔ should throw an error if the file does not exist + compile + ✔ should succeed if there are no files to compile + ✔ should succeed if there is one file to compile + ✔ should succeed if there are multiple files to compile + ✔ should fail if one file fails to compile (method error) + ✔ should fail if one file fails to compile (returned an error in the response) + ✔ should fail if one file fails to compile (returned multiple errors in the response) + ✔ should succeed if the compile returns a warning (returned a warning in the response) + createRulesets + with no initial rules + ✔ should not create rulesets if none were provided + ✔ should create rulesets if one was provided + ✔ should throw an error if createRuleset fails + ✔ should create multiple rulesets if multiple are provided + with initial rules + ✔ should throw an error if createRuleset fails + ✔ should not create rulesets if none were provided + ✔ should not create any additional rules if they all match + ✔ should create any rules for a single one that does not match + ✔ should create all rules if none match + with cross-service rules + ✔ should deploy even with IAM failure + ✔ should update permissions if prompted + ✔ should not update permissions if declined + ✔ should not prompt if role already granted + when there are quota issues + ✔ should throw if it return not a quota issue + ✔ should do nothing if there are not a lot of previous rulesets + and a prompt is made + ✔ should prompt for a choice (no) + ✔ should prompt for a choice (yes) and delete and retry creation + release + ✔ should release the rules + ✔ should enforce a subresource for storage + ✔ should append a subresource for storage + + shortenUrl + ✔ should return a shortened url with an unguessable suffix by default + ✔ should request a short suffix URL if guessable is true + ✔ should return the original URL in case of an error + + Throttler + Queue + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + Stack + ✔ should have no waiting task after creation + ✔ should return the task as the task name + ✔ should return the index as the task name + ✔ should return 'finished task' as the task name + ✔ should handle function tasks + ✔ should handle tasks + ✔ should not retry + ✔ should retry the number of retries, plus one + ✔ should handle tasks in concurrency + ✔ should retry the number of retries for mutiple identical tasks + ✔ should return the result of task + ✔ should resolve if task finishes before timeout + ✔ should reject if timeout (101ms) + ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) + ✔ should reject with TimeoutError if timeout while retrying (103ms) + ✔ should reject with TimeoutError when waiting + ✔ should reject with RetriesExhaustedError when waiting + + timeToWait + ✔ should wait the base delay on the first attempt + ✔ should back off exponentially + ✔ should not wait longer than maxDelay + + Queue + ✔ should have default name of queue + ✔ should be first-in-first-out + + Stack + ✔ should have default name of stack + ✔ should be first-in-last-out + ✔ should not repeat completed tasks + + unzip + ✔ should unzip a zip file with compressed-cp866 case + ✔ should unzip a zip file with compressed-directory-entry case + ✔ should unzip a zip file with compressed-flags-set case + ✔ should unzip a zip file with compressed-standard case + ✔ should unzip a zip file with uncompressed case + ✔ should unzip a zip file with zip-slip case + ✔ should unzip a zip file with zip64 case + + utils + consoleUrl + ✔ should create a console URL + getInheritedOption + ✔ should chain up looking for a key + ✔ should return undefined if the key does not exist + envOverride + ✔ should return the value if no current value exists + ✔ should set an override if it conflicts + ✔ should coerce the value + ✔ should return provided value if coerce fails + isCloudEnvironment + ✔ should return false by default + ✔ should return true when in codespaces + ✔ should return true when in Cloud Workstations + getDatabaseUrl + ✔ should create a url for prod + ✔ should create a url for the emulator + getDatabaseViewDataUrl + ✔ should get a view data url for legacy prod URL + ✔ should get a view data url for new prod URL + ✔ should get a view data url for the emulator + addDatabaseNamespace + ✔ should add the namespace for prod + ✔ should add the namespace for the emulator + addSubdomain + ✔ should add a subdomain + endpoint + ✔ should join our strings + promiseAllSettled + ✔ should settle all promises + promiseProps + ✔ should resolve all promises + ✔ should pass through objects + ✔ should reject if a promise rejects + datetimeString + ✔ should output the date in the correct format + streamToString/stringToStream + ✔ should be able to create and read streams + allSettled + ✔ handles arrays of length zero + ✔ handles a simple success + ✔ handles a simple failure + ✔ waits for all settled + groupBy + ✔ should transform simple array by fn + ✔ should transform array of objects by fn + withTimeout + ✔ should fulfill if the original promise fulfills within timeout + ✔ should reject if the original promise rejects within timeout + ✔ should reject with timeout if the original promise takes too long to fulfill + ✔ should reject with timeout if the original promise takes too long to reject + debounce + ✔ should be called only once in the given time interval + ✔ should be called only once if it is called many times within the interval + ✔ should be called only once within the interval if leading is provided + ✔ should be called twice with leading + connnectableHostname + ✔ should change wildcard IP addresses to corresponding loopbacks + ✔ should not change non-wildcard IP addresses or hostnames + + + 2542 passing (22s) + 4 pending + 1 failing + + 1) apiv2 + request + should error with a FirebaseError if JSON is malformed: + AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' + + + + +---------------------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +---------------------------------------|---------|----------|---------|---------|------------------- +All files | 55.82 | 43.53 | 51.61 | 55.93 | + src | 65.43 | 50.74 | 65.36 | 65.44 | + accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 + accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 + api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 + apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 + archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 + auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 + checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | + checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | + command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 + config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 + configstore.ts | 100 | 100 | 100 | 100 | + defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 + deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 + detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 + downloadUtils.ts | 100 | 100 | 100 | 100 | + dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 + ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 + ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | + error.ts | 100 | 91.3 | 100 | 100 | 55 + errorOut.ts | 30 | 0 | 0 | 30 | 10-22 + experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 + fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 + filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 + firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 + fsAsync.ts | 100 | 100 | 100 | 100 | + fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 + functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 + functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 + functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 + functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 + getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 + getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 + getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 + index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 + listFiles.ts | 100 | 100 | 100 | 100 | + loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 + localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 + logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 + logger.ts | 90 | 60 | 100 | 90 | 57-58 + operation-poller.ts | 100 | 100 | 100 | 100 | + parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 + profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 + profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 + projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 + projectUtils.ts | 100 | 90 | 100 | 100 | 43 + prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 + rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 + requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 + requireConfig.ts | 100 | 100 | 100 | 100 | + requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 + requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 + requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 + requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 + responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 + rtdb.ts | 30 | 0 | 0 | 30 | 16-45 + rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 + scopes.ts | 100 | 100 | 100 | 100 | + shortenUrl.ts | 100 | 100 | 100 | 100 | + track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 + unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 + utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 + src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | + client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 + distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 + options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 + src/commands | 36.91 | 0.9 | 2.27 | 37.13 | + appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 + appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 + appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 + apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 + apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 + apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 + apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 + apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 + apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 + auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 + auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 + ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 + crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 + crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 + database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 + database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 + database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 + database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 + database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 + database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 + database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 + database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 + database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 + database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 + database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 + deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 + emulators-exec.ts | 80 | 100 | 0 | 80 | 18 + emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 + emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 + experimental-functions-shell.ts | 100 | 100 | 100 | 100 | + experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 + experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 + experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 + ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 + ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 + ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 + ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 + ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 + ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 + ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 + ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 + ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 + ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 + ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 + ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 + ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 + ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 + ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 + ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 + firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 + firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 + firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 + firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 + firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 + firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 + firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 + functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 + functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 + functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 + functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 + functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 + functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 + functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 + functions-log.ts | 45 | 0 | 0 | 45 | 21-40 + functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 + functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 + functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 + functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 + functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 + functions-shell.ts | 100 | 100 | 100 | 100 | + help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 + hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 + hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 + hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 + hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 + hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 + hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 + hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 + hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 + hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 + hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 + hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 + index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 + init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 + ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 + ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 + login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 + login-ci.ts | 50 | 0 | 0 | 50 | 16-32 + login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 + login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 + login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 + logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 + open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 + projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 + projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 + projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 + remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 + remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 + remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 + serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 + setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 + setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 + target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 + target-clear.ts | 50 | 0 | 0 | 50 | 11-17 + target-remove.ts | 50 | 0 | 0 | 50 | 11-19 + target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 + use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 + src/crashlytics | 40 | 10 | 0 | 40 | + buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 + src/database | 81.27 | 54.37 | 90 | 80.76 | + api.ts | 100 | 100 | 100 | 100 | + import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 + listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 + remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 + removeRemote.ts | 100 | 100 | 100 | 100 | + rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 + settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 + src/deploy | 22.73 | 0 | 0 | 22.67 | + index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 + lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 + src/deploy/database | 38 | 0 | 0 | 34.04 | + deploy.ts | 100 | 100 | 0 | 100 | + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 + release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 + src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | + deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 + deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 + errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 + index.ts | 100 | 100 | 0 | 100 | + planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 + prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 + release.ts | 25 | 0 | 0 | 25 | 12-55 + secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 + tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 + v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 + validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 + src/deploy/firestore | 25 | 0 | 0 | 23.17 | + deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 + release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 + src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | + backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 + build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 + cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 + checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 + containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 + deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 + ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 + functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 + index.ts | 100 | 100 | 0 | 100 | + params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 + prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 + prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 + pricing.ts | 98 | 94.44 | 100 | 98 | 152 + prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 + triggerRegionHelper.ts | 100 | 100 | 100 | 100 | + validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 + src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | + applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 + hash.ts | 100 | 60 | 100 | 100 | 13-35 + src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | + executor.ts | 100 | 84.62 | 100 | 100 | 28-30 + fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 + index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 + planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 + reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 + sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 + timer.ts | 100 | 100 | 100 | 100 | + src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | + index.ts | 64 | 20 | 75 | 64 | 135-151 + ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | + index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 + parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 + v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 + src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | + extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 + index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 + parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 + parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 + validate.ts | 100 | 100 | 100 | 100 | + versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 + src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | + index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 + src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | + auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 + database.ts | 100 | 100 | 100 | 100 | + firebaseAlerts.ts | 100 | 100 | 100 | 100 | + firestore.ts | 100 | 80 | 100 | 100 | 14 + index.ts | 100 | 87.5 | 100 | 100 | 166 + remoteConfig.ts | 100 | 100 | 100 | 100 | + storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 + testLab.ts | 100 | 100 | 100 | 100 | + src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | + convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 + deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 + hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 + index.ts | 100 | 100 | 0 | 100 | + prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 + release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 + uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 + src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | + deploy.ts | 100 | 100 | 0 | 100 | + functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 + release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 + src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | + deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 + index.ts | 100 | 100 | 100 | 100 | + prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 + release.ts | 100 | 100 | 100 | 100 | + src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | + ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 + adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 + commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 + constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 + controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 + databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 + dns.ts | 100 | 100 | 100 | 100 | + download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 + downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 + emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 + env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 + eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 + eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 + extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 + firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 + functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 + functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 + functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 + functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 + functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 + hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 + hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 + hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 + hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 + loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 + portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 + pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 + registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 + types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 + ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 + workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 + src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | + apiSpec.ts | 100 | 100 | 100 | 100 | + cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 + errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 + handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 + index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 + operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 + server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 + state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 + utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 + widget_ui.ts | 100 | 100 | 100 | 100 | + src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | + postinstall.ts | 100 | 100 | 100 | 100 | + validation.ts | 97.14 | 84 | 100 | 97.14 | 78 + src/emulator/shared | 10 | 0 | 0 | 10 | + request.ts | 10 | 0 | 0 | 10 | 5-17 + src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | + cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 + crc.ts | 100 | 100 | 100 | 100 | + errors.ts | 100 | 100 | 100 | 100 | + files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 + index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 + metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 + multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 + persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 + server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 + upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 + src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | + firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 + gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 + shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 + src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | + config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 + manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 + runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 + types.ts | 100 | 100 | 100 | 100 | + utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 + src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | + askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 + askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 + billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 + change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 + checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 + diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 + displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 + etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 + export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 + extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 + extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 + listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 + localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 + manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 + metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 + paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 + provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 + publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 + publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 + refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 + resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 + secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 + tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 + types.ts | 100 | 100 | 100 | 100 | + updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 + utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 + versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 + warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 + src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | + optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 + specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 + triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 + src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | + api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 + api-types.ts | 100 | 100 | 100 | 100 | + api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 + checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 + delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 + encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 + fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 + util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 + validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 + src/frameworks | 25.22 | 9.12 | 25 | 26.07 | + constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 + index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 + utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 + src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | + index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 + utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 + src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | + index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 + utils.ts | 50 | 100 | 50 | 50 | 12-18 + src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | + index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 + src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | + filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 + frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 + frameworkSpec.ts | 100 | 100 | 100 | 100 | + index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 + src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | + docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 + hooks.ts | 100 | 100 | 100 | 100 | + index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 + local.ts | 20 | 0 | 0 | 20 | 8-44 + src/frameworks/express | 18.06 | 5.41 | 0 | 20 | + index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 + src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 + utils.ts | 83.33 | 50 | 100 | 83.33 | 7 + src/frameworks/lit | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | + constants.ts | 100 | 100 | 100 | 100 | + index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 + utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 + src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | + index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 + utils.ts | 100 | 75 | 100 | 100 | 10 + src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | + index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 + src/frameworks/preact | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/react | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/svelte | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | + index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 + src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | + index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 + src/functions | 90.45 | 81.48 | 83.58 | 90.17 | + constants.ts | 100 | 100 | 100 | 100 | + ensureTargeted.ts | 100 | 100 | 100 | 100 | + env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 + functionslog.ts | 100 | 100 | 100 | 100 | + projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 + python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 + runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 + secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 + src/functions/events | 100 | 100 | 100 | 100 | + index.ts | 100 | 100 | 100 | 100 | + v1.ts | 100 | 100 | 100 | 100 | + v2.ts | 100 | 100 | 100 | 100 | + src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | + artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 + auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 + cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 + cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 + cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 + cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 + cloudmonitoring.ts | 100 | 100 | 100 | 100 | + cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 + cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 + docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 + eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 + firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 + firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 + iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 + identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 + index.ts | 100 | 100 | 100 | 100 | + location.ts | 100 | 100 | 100 | 100 | + proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 + pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 + resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 + rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 + run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 + runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 + secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 + serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 + storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 + src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | + api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 + cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 + config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 + expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 + functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 + implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 + initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 + proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 + runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 + src/init | 36.84 | 0 | 0 | 36.84 | + index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 + src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | + account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 + database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 + emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 + index.ts | 100 | 100 | 100 | 100 | + project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 + remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 + storage.ts | 100 | 100 | 100 | 100 | + src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | + index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 + src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | + index.ts | 96 | 75 | 100 | 96 | 37 + indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 + rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 + src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | + index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 + javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 + npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 + typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 + src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | + github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 + index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 + src/management | 82.2 | 74.38 | 86 | 82.14 | + apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 + database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 + projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 + src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | + get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 + rollback.ts | 100 | 100 | 100 | 100 | + versionslist.ts | 100 | 80 | 100 | 100 | 24 + src/serve | 31.3 | 0 | 0 | 32.03 | + functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 + hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 + index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 + src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | + queue.ts | 90.91 | 75 | 100 | 90.91 | 17 + stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 + throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 + src/throttler/errors | 100 | 100 | 100 | 100 | + retries-exhausted-error.ts | 100 | 100 | 100 | 100 | + task-error.ts | 100 | 100 | 100 | 100 | + timeout-error.ts | 100 | 100 | 100 | 100 | +---------------------------------------|---------|----------|---------|---------|------------------- From 6311519b030e7a6ff709287af2fb7c0169efb3ad Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 12:00:31 -0700 Subject: [PATCH 100/104] Created node runtime to analyse framework --- output.txt | 78727 --------------------------------------------------- 1 file changed, 78727 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index 29199f81741..00000000000 --- a/output.txt +++ /dev/null @@ -1,78727 +0,0 @@ - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (251ms) - ✔ should throw when rewrite points to function being deleted (87ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8552ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (74ms) - #url - ✔ should craft URL from host and port in registry (74ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (151ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (73ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (512ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - 2) should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 4) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (246ms) - ✔ should throw when executable not found (249ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (107ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (23s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) RepositoryFileSystem - read - should read and return the contents of the file: - - AssertionError: expected { Object (name, version, ...) } to deeply equal { Object (name, version, ...) } - + expected - actual - - "description": "" - "keywords": [] - "license": "ISC" - "main": "index.js" - - "name": "expressapp" - + "name": "expressApp" - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - } - "version": "1.0.0" - - at Context. (src/test/frameworks/compose/discover/filesystem.spec.ts:45:47) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 4) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.51 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.28 | 77.43 | 82.24 | 85.19 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.74 | 84.39 | 96.15 | 91.91 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (286ms) - ✔ should throw when rewrite points to function being deleted (123ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (84ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9113ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (115ms) - ✔ once stopped, an emulator is no longer running (476ms) - #url - ✔ should craft URL from host and port in registry (175ms) - ✔ should quote IPv6 addresses (134ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (77ms) - ✔ should use ::1 instead of :: (147ms) - ✔ should use protocol from request if available (73ms) - ✔ should use host from request if available (75ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - 3) should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (253ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (256ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (25s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - - AssertionError: expected { Object (id, runtime, ...) } to equal { Object (id, runtime, ...) } - + expected - actual - - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - 3) frameworkMatcher - filterFrameworksWithFiles - should return frameworks having all the required files: - - AssertionError: expected [] to have the same members as [ Array(1) ] - + expected - actual - - -[] - +[ - + { - + "id": "express" - + "requiredDependencies": [] - + "requiredFiles": [ - + "package.json" - + "package-lock.json" - + ] - + "runtime": "nodejs" - + } - +] - - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:111:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.8 | 43.52 | 51.57 | 55.91 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.92 | 45.45 | 71.43 | 69.57 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 81.08 | 70 | 85.71 | 84.38 | 30,75,78-79,84 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (98ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9259ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (95ms) - ✔ once stopped, an emulator is no longer running (76ms) - #url - ✔ should craft URL from host and port in registry (79ms) - ✔ should quote IPv6 addresses (74ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (154ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (267ms) - ✔ should throw when npm root not found (261ms) - ✔ should throw when executable not found (276ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (120ms) - ✔ creates a new typescript codebase with the correct configuration (117ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.53 | 51.53 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 68.18 | 50 | 65 | 69.51 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 76.47 | 68.75 | 76.92 | 80 | 33-37,89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (102ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9239ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (107ms) - ✔ once stopped, an emulator is no longer running (83ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (164ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++++PPPPPP+++++++++++ -[ true, true ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -true -++++++++++BBBB+++++++++++ -++++++++++PPPPPP+++++++++++ -[ false ] -++++++++++PPPPPP+++++++++++ -++++++++++BBBBB+++++++++++ -false -++++++++++BBBB+++++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (259ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (265ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.14 | 57.14 | 75 | 75.61 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.2 | 81.25 | 92.31 | 91.11 | 89,92-93,98 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (220ms) - ✔ should throw when rewrite points to function being deleted (130ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9155ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (132ms) - ✔ once stopped, an emulator is no longer running (181ms) - #url - 2) should craft URL from host and port in registry - 3) should quote IPv6 addresses - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (148ms) - ✔ should use protocol from request if available (80ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++PPPP+++++++++ - 4) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles -++++++++PPPP+++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [], - requiredFiles: [ [Array] ] - } -] -++++++++PPPP+++++++++ - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (250ms) - ✔ should throw when executable not found (247ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (114ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2539 passing (27s) - 4 pending - 4 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should craft URL from host and port in registry: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) EmulatorRegistry - #url - should quote IPv6 addresses: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 4) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.54 | 51.58 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 75.29 | 57.14 | 75 | 74.68 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 89.58 | 81.25 | 92.31 | 90.48 | 86,89-90,95 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (362ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - 2) updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (88ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8595ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (158ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (79ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (522ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 3) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (254ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (252ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (124ms) - ✔ creates a new typescript codebase with the correct configuration (119ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (66ms) - ✔ should reject with TimeoutError if timeout while retrying (105ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (23s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: tenant management - updateTenants - updates tenant config: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/tenant.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:35) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.81 | 43.52 | 51.61 | 55.92 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (134ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (82ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9209ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (579ms) - ✔ once stopped, an emulator is no longer running (592ms) - #url - ✔ should craft URL from host and port in registry (458ms) - ✔ should quote IPv6 addresses (169ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (117ms) - ✔ should use ::1 instead of :: (741ms) - ✔ should use protocol from request if available (371ms) - ✔ should use host from request if available (101ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - 2) should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (257ms) - ✔ should throw when npm root not found (253ms) - ✔ should throw when executable not found (257ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (113ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (101ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (168ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (75ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8982ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (685ms) - ✔ once stopped, an emulator is no longer running (329ms) - #url - ✔ should craft URL from host and port in registry (89ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (75ms) - ✔ should use ::1 instead of :: (152ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (124ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (251ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (248ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (108ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (223ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (87ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8904ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (101ms) - ✔ once stopped, an emulator is no longer running (82ms) - #url - ✔ should craft URL from host and port in registry (83ms) - ✔ should quote IPv6 addresses (85ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (517ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (258ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (127ms) - ✔ creates a new typescript codebase with the correct configuration (109ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (77ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.47 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.67 | 94,97-98,103 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (112ms) - ✔ should throw when rewrite points to function being deleted (64ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8833ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (97ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (78ms) - ✔ should quote IPv6 addresses (78ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (514ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (664ms) - ✔ should throw when npm root not found (321ms) - ✔ should throw when executable not found (336ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.83 | 43.52 | 51.62 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 77.42 | 54.17 | 78.26 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.07 | 83.33 | 93.75 | 91.49 | 92,95-96,101 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (49ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (256ms) - ✔ should throw when rewrite points to function being deleted (76ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8626ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (76ms) - ✔ should quote IPv6 addresses (91ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (79ms) - ✔ should use ::1 instead of :: (155ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (121ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (260ms) - ✔ should throw when npm root not found (244ms) - ✔ should throw when executable not found (253ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (116ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (73ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (104ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (68ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 98,101-102,107 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (149ms) - ✔ should throw when rewrite points to function being deleted (63ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (90ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8882ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (90ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (86ms) - ✔ should quote IPv6 addresses (84ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (168ms) - ✔ should use protocol from request if available (78ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (516ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (263ms) - ✔ should throw when npm root not found (255ms) - ✔ should throw when executable not found (263ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (122ms) - ✔ creates a new typescript codebase with the correct configuration (114ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (80ms) - ✔ should reject with TimeoutError when timed out after failed retries (204ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled (38ms) - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (24s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.35 | 54.17 | 77.27 | 77.78 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.67 | 83.33 | 93.33 | 92.45 | 99,102-103,108 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (115ms) - ✔ should throw when rewrite points to function being deleted (55ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (77ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (9556ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (102ms) - ✔ once stopped, an emulator is no longer running (90ms) - #url - ✔ should craft URL from host and port in registry (84ms) - ✔ should quote IPv6 addresses (79ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (81ms) - ✔ should use ::1 instead of :: (165ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (81ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ -++++++DEP++++++++ -[Function: filterFrameworksWithDependencies] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[AsyncFunction: filterFrameworksWithFiles] -++++++EMB++++++++ -[Function: removeEmbededFrameworks] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -express -true -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -+++++++++++DDDDD++++++++ -+++++++++++SSS++++++++ -next -false -{ express: '^4.18.2' } -+++++++++++SSS++++++++ -++++++++RES+++++ -[ - { - id: 'express', - runtime: 'nodejs', - requiredDependencies: [ [Object] ] - } -] -++++++++RES+++++ - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (517ms) - ✔ should throw when npm root not found (796ms) - ✔ should throw when executable not found (1834ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (121ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (73ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (26s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.85 | 43.53 | 51.61 | 55.96 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 79.21 | 54.17 | 77.27 | 78.72 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 92.19 | 83.33 | 93.33 | 92.98 | 103,106-107,112 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (129ms) - ✔ should throw when rewrite points to function being deleted (54ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - 2) should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (101ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10908ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (109ms) - ✔ once stopped, an emulator is no longer running (93ms) - #url - ✔ should craft URL from host and port in registry (92ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (84ms) - ✔ should use ::1 instead of :: (169ms) - ✔ should use protocol from request if available (85ms) - ✔ should use host from request if available (87ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (291ms) - ✔ should throw when npm root not found (364ms) - ✔ should throw when executable not found (769ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (131ms) - ✔ creates a new typescript codebase with the correct configuration (121ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (203ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (103ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (29s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) Auth Emulator: accounts:createAuthUri - should find user by either IDP email or 'top-level' email: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/auth/createAuthUri.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response (78ms) - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (302ms) - ✔ should throw when rewrite points to function being deleted (40ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (89ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (10281ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (91ms) - ✔ once stopped, an emulator is no longer running (92ms) - #url - ✔ should craft URL from host and port in registry (91ms) - ✔ should quote IPv6 addresses (90ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (89ms) - ✔ should use ::1 instead of :: (170ms) - ✔ should use protocol from request if available (92ms) - ✔ should use host from request if available (113ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (117ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (288ms) - ✔ should throw when npm root not found (280ms) - ✔ should throw when executable not found (288ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (142ms) - ✔ creates a new typescript codebase with the correct configuration (146ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (72ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (100ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (27s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.53 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 76.92 | 54.17 | 77.27 | 76.19 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 90.74 | 83.33 | 93.33 | 91.49 | 93,96-97,102 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (126ms) - ✔ should throw when rewrite points to function being deleted (56ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (78ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8615ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (256ms) - ✔ once stopped, an emulator is no longer running (957ms) - #url - ✔ should craft URL from host and port in registry (893ms) - ✔ should quote IPv6 addresses (432ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (86ms) - ✔ should use ::1 instead of :: (249ms) - ✔ should use protocol from request if available (102ms) - 2) should use host from request if available - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (139ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (513ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 3) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (245ms) - ✔ should throw when executable not found (255ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (119ms) - ✔ creates a new typescript codebase with the correct configuration (105ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (70ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (102ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2540 passing (26s) - 4 pending - 3 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) EmulatorRegistry - #url - should use host from request if available: - Error: Timeout of 1000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/svnsairam/Documents/firestack/firebase-tools/src/test/emulators/registry.spec.ts) - at listOnTimeout (node:internal/timers:573:17) - at processTimers (node:internal/timers:514:7) - - 3) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (51ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (113ms) - ✔ should throw when rewrite points to function being deleted - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8835ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (94ms) - ✔ once stopped, an emulator is no longer running (79ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (77ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (82ms) - ✔ should use ::1 instead of :: (159ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (80ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (115ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (509ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (265ms) - ✔ should throw when npm root not found (249ms) - ✔ should throw when executable not found (272ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (123ms) - ✔ creates a new typescript codebase with the correct configuration (110ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (71ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (63ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (22s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:42:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (52ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (96ms) - ✔ should throw when rewrite points to function being deleted (59ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled (47ms) - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (76ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8923ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (93ms) - ✔ once stopped, an emulator is no longer running (80ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (80ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (80ms) - ✔ should use ::1 instead of :: (157ms) - ✔ should use protocol from request if available (76ms) - ✔ should use host from request if available (78ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (123ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher -++++++START++++++++ -++++++RUN++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - }, - { - id: 'nextjs', - runtime: 'nodejs', - webFrameworkId: 'Next.js', - requiredFiles: [ 'next.config.js', 'next.config.ts' ], - requiredDependencies: [ [Object] ], - commands: { build: [Object], dev: [Object], run: [Object] } - } -] -++++++DEP++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -+++++++EXPECT+++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} -+++++++ACTUAL+++++++ -Promise { } -+++++END+++++++ - 2) should return express FrameworkSpec after analysing express application -++++++FIL++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -1 -++++++EMB222++++++++ -[ - { - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ [Object] ] - } -] -++++++EMB333++++++++ -{ - id: 'express', - runtime: 'nodejs', - webFrameworkId: 'Express.js', - requiredDependencies: [ { name: 'express' } ] -} - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (252ms) - ✔ should throw when npm root not found (256ms) - ✔ should throw when executable not found (260ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (117ms) - ✔ creates a new typescript codebase with the correct configuration (112ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (71ms) - ✔ should reject with TimeoutError when timed out after failed retries (201ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (62ms) - ✔ should reject with TimeoutError if timeout while retrying (102ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2541 passing (23s) - 4 pending - 2 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - 2) frameworkMatcher - frameworkMatcher - should return express FrameworkSpec after analysing express application: - AssertionError: expected {} to deeply equal { Object (id, runtime, ...) } - at Context. (src/test/frameworks/compose/discover/frameworkMatcher.spec.ts:48:40) - at processImmediate (node:internal/timers:478:21) - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.84 | 43.52 | 51.61 | 55.94 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.23 | 77.36 | 82.24 | 85.14 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 91.45 | 83.97 | 96.15 | 91.62 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 78.13 | 54.17 | 77.27 | 77.53 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 91.53 | 83.33 | 93.33 | 92.31 | 94,97-98,106 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- - -> firebase-tools@12.3.1 mocha -> nyc mocha 'src/test/**/*.{ts,js}' - - - - accountExporter - validateOptions - ✔ should reject when no format provided - ✔ should reject when format is not csv or json - ✔ should ignore format param when implicitly specified in file name - ✔ should use format param when not implicitly specified in file name - serialExportUsers - ✔ should call api.request multiple times for JSON export - ✔ should call api.request multiple times for CSV export - ✔ should encapsulate displayNames with commas for csv formats - ✔ should not emit redundant comma in JSON on consecutive calls - ✔ should export a user's custom attributes for JSON formats - ✔ should export a user's custom attributes for CSV formats - - accountImporter - transArrayToUser - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - validateOptions - ✔ should reject when unsupported hash algorithm provided - ✔ should reject when missing parameters - validateUserJson - ✔ should reject when unknown fields in user json - ✔ should reject when unknown fields in providerUserInfo of user json - ✔ should reject when unknown providerUserInfo of user json - ✔ should reject when passwordHash is invalid base64 - ✔ should not reject when passwordHash is valid base64 - serialImportUsers - ✔ should call api.request multiple times - ✔ should continue when some request's response is 200 but has `error` in response - - api - ✔ should override with FIRESTORE_URL - ✔ should prefer FIRESTORE_EMULATOR_HOST to FIRESTORE_URL - - apiv2 - request - ✔ should throw on a basic 404 GET request - ✔ should be able to resolve on a 404 GET request - ✔ should make a basic GET request - ✔ should be able to handle specified retry codes - ✔ should return an error if the retry never succeeds - ✔ should be able to resolve the error response if retry codes never succeed - ✔ should not allow resolving on http error when streaming - ✔ should be able to stream a GET request - ✔ should set a bearer token to 'owner' if making an insecure, local request - 1) should error with a FirebaseError if JSON is malformed - ✔ should error with a FirebaseError if an error happens - ✔ should error with a FirebaseError if an invalid responseType is provided - ✔ should resolve a 400 GET request - ✔ should resolve a 404 GET request - ✔ should be able to resolve a stream on a 404 GET request - ✔ should make a basic GET request if path didn't include a leading slash - ✔ should make a basic GET request if urlPrefix did have a trailing slash - ✔ should make a basic GET request with an api version - ✔ should make a basic GET request with a query string - ✔ should make a basic GET request and not override the user-agent - ✔ should handle a 204 response with no data - ✔ should be able to time out if the request takes too long - ✔ should be able to be killed by a signal - ✔ should make a basic POST request - ✔ should make a basic POST request without overriding Content-Type - ✔ should make a basic POST request with a stream - ✔ should preserve XML messages - ✔ should preserve XML messages on error - with a proxy - ✔ should be able to make a basic GET request - verbs - ✔ should make a GET request - ✔ should make a POST request - ✔ should make a PUT request - ✔ should make a PATCH request - ✔ should make a DELETE request - - distribution - addTesters - ✔ should throw error if request fails - ✔ should resolve when request succeeds - deleteTesters - ✔ should throw error if delete fails - ✔ should resolve when request succeeds - uploadRelease - ✔ should throw error if upload fails - ✔ should return token if upload succeeds - updateReleaseNotes - ✔ should return immediately when no release notes are specified - ✔ should throw error when request fails - ✔ should resolve when request succeeds - distribute - ✔ should return immediately when testers and groups are empty - ✔ should resolve when request succeeds - when request fails - ✔ should throw invalid testers error when status code is FAILED_PRECONDITION - ✔ should throw invalid groups error when status code is INVALID_ARGUMENT - ✔ should throw default error - - archiveDirectory - ✔ should archive happy little directories - ✔ should throw a happy little error if the directory doesn't exist - - auth - no accounts - ✔ returns no global account when config is empty - single account - ✔ returns global default account - ✔ returns no additional accounts - ✔ returns exactly one total account - multi account - ✔ returns global default account - ✔ returns additional accounts - ✔ returns all accounts - ✔ respects project default when present - ✔ ignores project default when not present - ✔ prefers account flag to project root - - checkMinRequiredVersion - ✔ should error if installed version is below the min required version - ✔ should not error if installed version is above the min required version - - checkValidTargetFilters - ✔ should resolve - ✔ should resolve if there are no 'only' targets specified - ✔ should error if an only option and except option have been provided - ✔ should error if non-filter-type target (remoteconfig) has filters - ✔ should error if non-filter-type target (extensions) has filters - ✔ should error if the same target is specified with and without a filter - - Command - ✔ should allow all basic behavior - runner - ✔ should work when no arguments are passed and options - ✔ should execute befores before the action - ✔ should terminate execution if a before errors - ✔ should reject the promise if an error is thrown - ✔ should resolve a numeric --project flag into a project id - ✔ should resolve a non-numeric --project flag into a project id - - validateProjectId - ✔ should not throw for valid project ids - ✔ should not throw for legacy project ids - ✔ should block invalid project ids - ✔ should error with additional note for uppercase project ids - - Config - #load - ✔ should load a cjson file when configPath is specified - #parseFile - ✔ should load a cjson file - ✔ should error out for an unknown file - ✔ should error out for an unrecognized extension - #materialize - ✔ should assign unaltered if an object is found - ✔ should prevent top-level key duplication - - api - ✔ should add HTTP to emulator URL with no protocol - ✔ should not add HTTP to emulator URL with https:// protocol - ✔ should override with FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_DATABASE_EMULATOR_HOST to FIREBASE_REALTIME_URL - ✔ should prefer FIREBASE_REALTIME_URL when run without emulator - ✔ should ignore FIREBASE_DATABASE_EMULATOR_HOST when run without emulator - - FakeListRemote - ✔ should return limit the number of subpaths returned - - FakeRemoveRemote - ✔ should failed to delete large path / - ✔ should sucessfully delete large path / - ✔ should failed to delete large path /1 - ✔ should successfully delete path /1/a - ✔ should failed to delete large paths /1/a /1/b - ✔ should successfully delete multi paths /1/c /1/d - - DatabaseImporter - ✔ throws FirebaseError when JSON is invalid - ✔ batches data from different top-level objects - ✔ writes data as a single batch for large enough payload size - ✔ imports from data path - ✔ writes primitive as object - ✔ writes array as object - ✔ throws FirebaseError when data location is nonempty - ✔ retries non-fatal connection timeout error - - ListRemote - ✔ should return subpaths from shallow get request - - DatabaseRemove - ✔ should remove tiny tree - ✔ should remove subtree at /a/b/c - DatabaseRemove when largeThreshold=100 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=10 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - DatabaseRemove when largeThreshold=1 - ✔ should remove nested tree - ✔ should remove flat tree when threshold=${threshold} - - RemoveRemote - ✔ should return true when patch is small - ✔ should return false whem patch is large - ✔ should return true when multi-path patch is small - ✔ should return false when multi-path patch is large - ✔ should send disableTriggers param - - defaultCredentials - ✔ creates a credential file when there are tokens in the config - ✔ can clear credentials - ✔ includes the users email in the path - - Extensions Deployment Planner - resolveSemver - ✔ should return the latest version that satisifies a semver range - ✔ should match exact semver - ✔ should resolve latest to a version - ✔ should default to latest-approved version - ✔ should resolve explicit latest-approved - ✔ should error if there is no matching version - have - ✔ have() should return correct instance spec with events - ✔ have() should return correct instance spec with undefined events config - ✔ have() should return correct instance spec with empty events config - - ensureNecessaryV2ApisAndRoles - ✔ should succeed when IAM policy is correct - ✔ should fix the IAM policy by adding missing bindings - - Backend - Helper functions - ✔ isEmptyBackend - ✔ names - ✔ merge - existing backend - existingBackend - ✔ should throw error when functions list fails - ✔ should cache - ✔ should translate functions - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should throw an error if v2 list api throws an error - ✔ should read v1 functions only when user is not allowlisted for v2 - ✔ should read v2 functions when enabled - ✔ should deduce features of scheduled functions - checkAvailability - ✔ should throw error when functions list fails - ✔ should do nothing when regions are all avalable - ✔ should warn if an unused GCFv1 backend is unavailable - ✔ should warn if an unused GCFv2 backend is unavailable - ✔ should throw if a needed GCFv1 region is unavailable - ✔ should throw if a GCFv2 needed region is unavailable - ✔ Should only warn when deploying GCFv1 and GCFv2 is unavailable. - ✔ Should only warn when deploying GCFv2 and GCFv1 is unavailable. - compareFunctions - ✔ should compare different platforms - ✔ should compare different regions, same platform - ✔ should compare different ids, same platform & region - ✔ should compare same ids - comprehension helpers - ✔ allEndpoints - ✔ matchingBackend - ✔ someEndpoint - ✔ findEndpoint - ✔ regionalEndpoints - ✔ hasEndpoint - ✔ missingEndpoint - - toBackend - ✔ populates backend info from Build - ✔ doesn't populate if omit is set on the build - ✔ populates multiple specified invokers correctly - - applyHash - applyBackendHashToBackends - ✔ should applyHash to each endpoint of a given backend - - getBackendHash - getEnvironmentVariablesHash - ✔ should return different hash given different env variables - ✔ should return same hash given same env variables - getSecretsHash - ✔ should return different hash given different secret versions - ✔ should return same hash given same secret versions - getSourceHash - ✔ should return different hash given different files - ✔ should return the same hash given the same file - getEndpointHash - ✔ should return different hash given hashes - ✔ should return different hash given partial difference - ✔ should return same hash given same hashes - ✔ should filter out undefined hashes - - CEL evaluation - String list resolution - ✔ can pull lists directly out of paramvalues - ✔ can handle literals in a list - ✔ can handle CEL expressions in a list - ✔ can handle direct references to string params in a list - ✔ can handle a list with multiple elements - ✔ isn't picky about whitespace around the commas - ✔ can do == comparisons between lists - ✔ throws if asked to do type comparisons between lists - Identity expressions - ✔ raises when the referenced parameter does not exist - ✔ raises when the referenced parameter is of the wrong type - ✔ pulls number parameters - Comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Dual comparison expressions - ✔ raises when the LHS param does not exist - ✔ raises when the RHS param does not exist - ✔ raises when a literal is provided as the LHS - ✔ raises when the type of the LHS and RHS do not match - ✔ it determines whether or not the LHS resolves to the same thing as the RHS if cmp is == - ✔ it handles the other cmp values using javascript's default behavior, even the stupid ones - Ternary expressions conditioned on an comparison test - ✔ raises when the LHS param does not exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on an comparison test between two params - ✔ raises when one of the params to compare doesn't exist - ✔ raises when the type of the LHS and RHS do not match - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - ✔ it knows how to handle non-== comparisons by delegating to the Comparison expression evaluators - Ternary expressions conditioned on a boolean parameter - ✔ raises when the condition param does not exist - ✔ raises when the condition param is not a boolean - ✔ raises when the ternary expression evaluates to something of the wrong type - ✔ raises when the ternary expression evaluates to a missing parameter - ✔ it provides resolved parameters when the ternary expression calls for them - ✔ it provides literal expressions when the ternary expression calls for them - - checkIam - ✔ should add the pubsub publisher role for a new v2 storage function with v2 deployed functions - ✔ should add the default bindings for a new v2 alerts function without v2 deployed functions - ✔ should not add bindings for a new v2 alerts function with v2 deployed functions - ✔ should add the default bindings for a new v2 remote config function without v2 deployed functions - ✔ should not add bindings for a new v2 remote config function with v2 deployed functions - ✔ should add the default bindings for a new v2 test lab function without v2 deployed functions - ✔ should not add bindings for a new v2 test lab function with v2 deployed functions - obtainPubSubServiceAgentBindings - ✔ should obtain the bindings - obtainDefaultComputeServiceAgentBindings - ✔ should obtain the bindings - mergeBindings - ✔ should not update the policy when the bindings are present - ✔ should update the members of a binding in the policy - ✔ should add a new binding to the policy - ensureServiceAgentRoles - ✔ should return early if we do not have new services - ✔ should return early if we fail to get the IAM policy - ✔ should error if we fail to set the IAM policy - ✔ should add the pubsub publisher role and all default bindings for a new v2 storage function without v2 deployed functions - - CleanupBuildImages - ✔ uses GCR and AR - ✔ reports failed domains from AR - ✔ reports failed domains from GCR - - DockerHelper - ✔ Fetches tags with caching - ✔ Deletes recursively - - ArtifactRegistryCleaner - ✔ deletes artifacts - ✔ deletes cache dirs - ✔ bypasses poller if the operation is completed - ✔ encodeds to avoid upper-case letters - - ContainerRegistryCleaner - ✔ Handles cleanup of first function in the region - ✔ Handles cleanup of second function in the region - ✔ Leaves other directories alone - - listGcfPaths - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail search - ✔ should list paths, single location param - ✔ should list paths, multiple locations param - ✔ should list paths, only locations in gcr - ✔ should list paths, all locations - - deleteGcfArtifacts - ✔ should throw an error on invalid location - ✔ should throw an error when subdomains fail deletion - ✔ should delete a location - ✔ should delete multiple locations - ✔ should purge all locations - - deploy - shouldUploadBeSkipped - ✔ should skip if all endpoints are identical - ✔ should not skip if hashes don't match - ✔ should not skip if haveBackend is missing - ✔ should not skip if wantBackend is missing - ✔ should not skip if endpoint filter is specified - - ensureCloudBuildEnabled() - with cloudbuild service enabled - ✔ should succeed - with cloudbuild service disabled, but enabling succeeds - ✔ should succeed - with cloudbuild service disabled, but enabling fails with billing error - ✔ should error - with cloudbuild service disabled, but enabling fails with permission error - ✔ should error - - ensureSecretAccess - ✔ ensures access to default service account - ✔ ensures access to all secrets - ✔ combines service account to make one call per secret - ✔ skips calling IAM if secret is already bound to a service account - ✔ does not include service account already bounud to a secret - - functionsDeployHelper - endpointMatchesFilter - ✔ should match empty filter - ✔ should match full names - ✔ should match group prefixes - ✔ should not match function that id that don't match - ✔ should not match function in different codebase - ✔ should match function if backend's codebase is undefined - ✔ should match function matching ids given no codebase - endpointMatchesAnyFilters - ✔ should match given no filters - ✔ should match against one filter - ✔ should exclude functions that don't match - parseFunctionSelector - ✔ parses selector without codebase - ✔ parses group selector (with '.') without codebase - ✔ parses group selector (with '-') without codebase - ✔ parses group selector (with '-') with codebase - getEndpointFilters - ✔ should parse multiple selectors - ✔ should parse nested selector - ✔ should parse selector with codebase - ✔ should parse nested selector with codebase - ✔ returns undefined given no only option - ✔ returns undefined given no functions selector - targetCodebases - ✔ returns all codebases in firebase.json with empty filters - ✔ returns only codebases included in the filters - ✔ correctly deals with duplicate entries - ✔ returns all codebases given filter without codebase specified - groupEndpointsByCodebase - ✔ groups codebase using codebase property - ✔ claims endpoint with matching name regardless of codebase property - - CEL resolution - ✔ can interpolate a provided param into a CEL expression - ✔ can interpolate multiple params into a CEL expression - ✔ throws instead of coercing a param value with the wrong type - ✔ can't handle non-identity CEL expressions yet - - resolveParams - ✔ always contains the precanned internal param values - ✔ can pull a literal value out of the dotenvs - ✔ params from dotenvs override internal params of the same name - ✔ does not create the corresponding internal params if database url/storage bucket are not configured - ✔ can use a provided literal - ✔ can resolve a CEL identity expression - ✔ can resolve a CEL expression containing only identities - ✔ can resolve a CEL expression depending on the internal params - ✔ errors when the default is an unresolvable CEL expression - ✔ errors when the default is a CEL expression that resolves to the wrong type - - prepare - inferDetailsFromExisting - ✔ merges env vars if .env is not used - ✔ overwrites env vars if .env is used - ✔ can noop when there is no prior endpoint - ✔ can fill in regions from last deploy - ✔ doesn't fill in regions if triggers changed - ✔ fills in instance size - ✔ downgrades concurrency if necessary (explicit) - ✔ downgrades concurrency if necessary (implicit) - ✔ upgrades default concurrency with CPU upgrades - inferBlockingDetails - ✔ should merge the blocking options and set default value - updateEndpointTargetedStatus - ✔ should mark targeted codebases - ✔ should mark targeted codebases + ids - ✔ should mark targeted ids - - prepareFunctionsUpload - convertToSortedKeyValueArray - ✔ should deep sort the resulting array when an input config object is not sorted - ✔ should return null when config input is null - ✔ should return an empty array when config input is an empty object - - Functions Pricing - canCalculateMinInstanceCost - ✔ Can calculate the $0 cost of a function without min instances - ✔ Can calculate the cost of a well formed v1 function - ✔ Can calculate the cost of a well formed v2 function - ✔ Cannot calculate the cost of an unknown instance size - ✔ Cannot calculate the cost for an unknown region - monthlyMinInstanceCost - ✔ can calculate a v1 tier1 bill - ✔ doesn't estimate bills for unreserved instances - ✔ can calculate a bill for a two reserved instances - ✔ Can calculate a v1 tier1 bill for a two reserved instance between two functions - ✔ can calculate a v1 tier2 bill - ✔ can calculate a v1 bill for large instances - ✔ can calculate a v2 tier1 bill - ✔ can calculate a v2 tier2 bill - ✔ can calculate a v2 bill for large instances - ✔ calculates v1 and v2 discounts separately - - promptForFailurePolicies - ✔ should prompt if there are new functions with failure policies - ✔ should not prompt if all functions with failure policies already had failure policies - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function adds a failure policy - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with failure policies - ✔ should throw if there are any functions with failure policies, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with failure policies, in noninteractive mode, with the force flag set - - promptForMinInstances - ✔ should prompt if there are new functions with minInstances - ✔ should not prompt if no fucntion has minInstance - ✔ should not prompt if all functions with minInstances already had the same number of minInstances - ✔ should not prompt if functions decrease in minInstances - ✔ should throw if user declines the prompt - ✔ should prompt if an existing function sets minInstances - ✔ should prompt if an existing function increases minInstances - ✔ should prompt if a minInstance function increases resource reservations - ✔ should throw if there are any functions with failure policies and the user doesn't accept the prompt - ✔ should not prompt if there are no functions with minInstances - ✔ should throw if there are any functions with minInstances, in noninteractive mode, without the force flag set - ✔ should not throw if there are any functions with minInstances, in noninteractive mode, with the force flag set - ✔ Should disclaim if a bill cannot be calculated - - Executor - QueueExecutor - ✔ supports arbitrary return types - ✔ throws errors - ✔ retries temporary errors - ✔ eventually gives up on retryable errors - ✔ retries on custom specified retry codes - - Fabricator - ✔ does not delete if there are upsert errors - ✔ applies all kinds of changes - createV1Function - ✔ throws on create function failure - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ sets public invoker by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ always sets invoker to public - taskQueueTrigger - ✔ enforces SECURE_ALWAYS HTTPS policies - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ sets the invoker to public - updateV1Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV1Function - ✔ throws on delete function failure - createV2Function - ✔ handles topics that already exist - ✔ handles failures to create a topic - ✔ handles already existing eventarc channels - ✔ handles already existing eventarc channels (createChannel return 409) - ✔ creates channels if necessary - ✔ wraps errors thrown while creating channels - ✔ throws on create function failure - ✔ deletes broken function and retries on cloud run quota exhaustion - ✔ throws on set invoker failure - ✔ doesn't set invoker on non-http functions - httpsTrigger - ✔ sets invoker to public by default - ✔ sets explicit invoker - ✔ doesn't set private invoker on create - callableTrigger - ✔ always sets invoker to public - taskQueueTrigger - ✔ doesn't set invoker by default - ✔ sets explicit invoker - blockingTrigger - ✔ always sets invoker to public - updateV2Function - ✔ throws on update function failure - ✔ throws on set invoker failure - ✔ sets explicit invoker on httpsTrigger - ✔ sets explicit invoker on taskQueueTrigger - ✔ sets explicit invoker on blockingTrigger - ✔ does not set invoker by default - ✔ doesn't set invoker on non-http functions - deleteV2Function - ✔ throws on delete function failure - upsertScheduleV1 - ✔ upserts schedules - ✔ wraps errors - upsertScheduleV2 - ✔ upserts schedules - ✔ wraps errors - deleteScheduleV1 - ✔ deletes schedules and topics - ✔ wraps errors - deleteScheduleV2 - ✔ deletes schedules and topics - ✔ wraps errors - upsertTaskQueue - ✔ upserts task queues - ✔ sets enqueuer - ✔ wraps errors - disableTaskQueue - ✔ disables task queues - ✔ wraps errors - registerBlockingTrigger - ✔ registers auth blocking trigger - ✔ wraps errors - unregisterBlockingTrigger - ✔ unregisters auth blocking trigger - ✔ wraps errors - setTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers without channels - ✔ sets schedule triggers - ✔ sets task queue triggers - deleteTrigger - ✔ does nothing for HTTPS functions - ✔ does nothing for event triggers - ✔ deletes schedule triggers - ✔ deletes task queue triggers - createEndpoint - ✔ creates v1 functions - ✔ creates v2 functions - ✔ aborts for failures midway - updateEndpoint - ✔ updates v1 functions - ✔ updates v2 functions - ✔ aborts for failures midway - ✔ can delete and create - deleteEndpoint - ✔ deletes v1 functions - ✔ deletes v2 functions - ✔ does not delete functions with triggers outstanding - applyRegionalUpdates - ✔ shares source token scrapers across upserts - ✔ handles errors and wraps them in results - getLogSuccessMessage - ✔ should return appropriate messaging for create case - ✔ should return appropriate messaging for skip case - getSkippedDeployingNopOpMessage - ✔ should return appropriate messaging - applyPlan - ✔ fans out to regions - - planner - ✔ detects changes to v2 pubsub topics - ✔ detects upgrades to scheduled functions - calculateUpdate - ✔ throws on illegal updates - ✔ knows to delete & recreate for v2 topic changes - ✔ knows to delete & recreate for v1 to v2 scheduled function upgrades - ✔ knows to delete & recreate when trigger regions change - ✔ knows to upgrade in-place in the general case - calculateRegionalChanges - ✔ passes a smoke test - ✔ adds endpoints with matching hashes to skip list - ✔ adds endpoints to update list if they dont have hashes - ✔ adds endpoints to update list if they have different hashes - ✔ does not add endpoints to skip list if not targeted for deploy - ✔ can be told to delete all functions - createDeploymentPlan - ✔ groups deployment by region and memory - ✔ applies filters - ✔ nudges users towards concurrency settings when upgrading and not setting - ✔ does not warn users about concurrency when inappropriate - checkForIllegalUpdate - ✔ prohibits upgrades from v1 to v2 - ✔ should throw if a https function would be changed into an event triggered function - ✔ should throw if a event triggered function would be changed into an https function - ✔ should throw if a scheduled trigger would change into an https function - ✔ should not throw if a event triggered function keeps the same trigger - ✔ should not throw if a https function stays as a https function - ✔ should not throw if a scheduled function stays as a scheduled function - ✔ should throw if a user downgrades from v2 to v1 - - reporter - triggerTag - ✔ detects v1.https - ✔ detects v2.https - ✔ detects v1.callable - ✔ detects v2.callable - ✔ detects v1.scheduled - ✔ detects v2.scheduled - ✔ detects v1.blocking - ✔ detects v2.blocking - ✔ detects others - logAndTrackDeployStats - ✔ tracks global summaries - ✔ tracks v1 vs v2 codebases - ✔ tracks overall success/failure - printErrors - ✔ does nothing if there are no errors - ✔ only prints summaries for non-aborted errors - ✔ prints IAM errors - ✔ prints quota errors - ✔ prints aborted errors - - SourceTokenScraper - ✔ immediately provides the first result - ✔ provides results after the first operation completes - ✔ provides tokens from an operation - ✔ refreshes token after timer expires (50ms) - ✔ concurrent requests for source token - - yamlToBuild - ✔ Accepts a valid v1alpha1 spec - ✔ Requires a spec version - ✔ Throws on unknown spec versions - - detectFromYaml - ✔ succeeds when YAML can be found - ✔ returns undefined when YAML cannot be found - - detectFromPort - ✔ passes as smoke test - - requireKeys - ✔ accepts found keys - ✔ throws for missing keys - ✔ uses prefixes in error messages - - assertKeyTypes - ✔ handles a null when expecting a string - ✔ handles a undefined when expecting a string - ✔ handles a number when expecting a string - ✔ handles a boolean when expecting a string - ✔ handles a string when expecting a string - ✔ handles a array when expecting a string - ✔ handles a object when expecting a string - ✔ handles a null when expecting a number - ✔ handles a undefined when expecting a number - ✔ handles a number when expecting a number - ✔ handles a boolean when expecting a number - ✔ handles a string when expecting a number - ✔ handles a array when expecting a number - ✔ handles a object when expecting a number - ✔ handles a null when expecting a boolean - ✔ handles a undefined when expecting a boolean - ✔ handles a number when expecting a boolean - ✔ handles a boolean when expecting a boolean - ✔ handles a string when expecting a boolean - ✔ handles a array when expecting a boolean - ✔ handles a object when expecting a boolean - ✔ handles a null when expecting a array - ✔ handles a undefined when expecting a array - ✔ handles a number when expecting a array - ✔ handles a boolean when expecting a array - ✔ handles a string when expecting a array - ✔ handles a array when expecting a array - ✔ handles a object when expecting a array - ✔ handles a null when expecting a object - ✔ handles a undefined when expecting a object - ✔ handles a number when expecting a object - ✔ handles a boolean when expecting a object - ✔ handles a string when expecting a object - ✔ handles a array when expecting a object - ✔ handles a object when expecting a object - ✔ handles a null when expecting a string? - ✔ handles a undefined when expecting a string? - ✔ handles a number when expecting a string? - ✔ handles a boolean when expecting a string? - ✔ handles a string when expecting a string? - ✔ handles a array when expecting a string? - ✔ handles a object when expecting a string? - ✔ handles a null when expecting a number? - ✔ handles a undefined when expecting a number? - ✔ handles a number when expecting a number? - ✔ handles a boolean when expecting a number? - ✔ handles a string when expecting a number? - ✔ handles a array when expecting a number? - ✔ handles a object when expecting a number? - ✔ handles a null when expecting a boolean? - ✔ handles a undefined when expecting a boolean? - ✔ handles a number when expecting a boolean? - ✔ handles a boolean when expecting a boolean? - ✔ handles a string when expecting a boolean? - ✔ handles a array when expecting a boolean? - ✔ handles a object when expecting a boolean? - ✔ handles a null when expecting a array? - ✔ handles a undefined when expecting a array? - ✔ handles a number when expecting a array? - ✔ handles a boolean when expecting a array? - ✔ handles a string when expecting a array? - ✔ handles a array when expecting a array? - ✔ handles a object when expecting a array? - ✔ handles a null when expecting a object? - ✔ handles a undefined when expecting a object? - ✔ handles a number when expecting a object? - ✔ handles a boolean when expecting a object? - ✔ handles a string when expecting a object? - ✔ handles a array when expecting a object? - ✔ handles a object when expecting a object? - ✔ handles validator functions - ✔ Throws on superfluous keys - ✔ Ignores 'omit' keys - ✔ Handles prefixes - - buildFromV1Alpha - parser errors - ✔ detects missing triggers - build keys - ✔ throws on the empty object - ✔ throws on invalid value for top-level key requiredAPIS - ✔ throws on invalid value for top-level key endpoints - ✔ throws on unknown keys - Endpoint keys - ✔ invalid keys - ✔ missing Endpoint key entryPoint - ✔ missing Endpoint key platform - ✔ missing Endpoint key project - ✔ missing Endpoint key region - ✔ missing Endpoint key runtime - ✔ invalid value for CloudFunction key platform - ✔ invalid value for CloudFunction key id - ✔ invalid value for CloudFunction key region - ✔ invalid value for CloudFunction key project - ✔ invalid value for CloudFunction key runtime - ✔ invalid value for CloudFunction key entryPoint - ✔ invalid value for CloudFunction key availableMemoryMb - ✔ invalid value for CloudFunction key maxInstances - ✔ invalid value for CloudFunction key minInstances - ✔ invalid value for CloudFunction key serviceAccount - ✔ invalid value for CloudFunction key timeoutSeconds - ✔ invalid value for CloudFunction key trigger - ✔ invalid value for CloudFunction key vpcConnector - ✔ invalid value for CloudFunction key vpcConnectorEgressSettings - ✔ invalid value for CloudFunction key labels - ✔ invalid value for CloudFunction key ingressSettings - ✔ invalid value for CloudFunction key cpu - Event triggers - ✔ missing event trigger key eventType - ✔ invalid value for event trigger key eventType - ✔ invalid value for event trigger key eventFilters - ✔ invalid value for event trigger key retry - ✔ invalid value for event trigger key region - ✔ invalid value for event trigger key serviceAccount - ✔ invalid value for event trigger key channel - httpsTriggers - ✔ invalid value for https trigger key invoker - scheduleTriggers - ✔ invalid value for schedule trigger key schedule - ✔ invalid value for schedule trigger key timeZone - blockingTriggers - ✔ invalid value for blocking trigger key eventType - ✔ invalid value for blocking trigger key options - null handling - ✔ handles null top-level keys - ✔ handles nulls in event triggers - ✔ handles null in https triggers - ✔ handles nulls in task queue triggers2 - ✔ handles null in scheduled triggers - Params - ✔ copies param fields - Endpoint keys - ✔ fills default backend and function fields - ✔ allows some fields of the endpoint to have a Field<> type - ✔ allows both CEL and lists containing CEL in FieldList typed keys - ✔ copies schedules - ✔ copies schedules including Field types - ✔ copies event triggers - ✔ copies event triggers with optional values - ✔ copies event triggers with optional values of Field<> types - ✔ copies event triggers with full resource path - ✔ copies blocking triggers - ✔ copies blocking triggers without options - ✔ copies optional fields - ✔ handles multiple regions - - getHumanFriendlyRuntimeName - ✔ should properly convert raw runtime to human friendly runtime - - extractTriggers - ✔ should find exported functions with __trigger - ✔ should attach name and entryPoint to exported triggers - ✔ should find nested functions and set name and entryPoint - ✔ should ignore null exports - - NodeDelegate - getNodeBinary - ✔ prefers locally cached node version if matched with requested version - ✔ checks if requested and hosted runtime version matches - ✔ warns users if hosted and requested runtime version differs - ✔ throws errors if requested runtime version is invalid - - getRuntimeChoice - when the runtime is set in firebase.json - ✔ should error if runtime field is set to node 6 - ✔ should error if runtime field is set to node 8 - ✔ should return node 10 if runtime field is set to node 10 - ✔ should return node 12 if runtime field is set to node 12 - ✔ should return node 14 if runtime field is set to node 14 - ✔ should return node 16 if runtime field is set to node 16 - ✔ should throw error if unsupported node version set - when the runtime is not set in firebase.json - ✔ should error if engines field is set to node 6 - ✔ should error if engines field is set to node 8 - ✔ should return node 10 if engines field is set to node 10 - ✔ should return node 12 if engines field is set to node 12 - ✔ should return node 14 if engines field is set to node 14 - ✔ should return node 16 if engines field is set to node 16 - ✔ should print warning when firebase-functions version is below 2.0.0 - ✔ should not throw error if user's SDK version fails to be fetched - ✔ should throw error if unsupported node version set - - addResourcesToBuild - ✔ should handle a minimal https trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a callable trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should handle a minimal task queue trigger, yielding a build reversibly equivalent to the corresponding backend - ✔ should copy fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should rename/transform fields, yielding a build reversibly equivalent to the corresponding backend - ✔ should support multiple regions, yielding a build reversibly equivalent to the corresponding backend - ✔ should support schedules, yielding a build reversibly equivalent to the corresponding backend - ✔ should expand vpc connector in w/ shorthand form - ✔ should preserve empty vpc connector setting, yielding a build reversibly equivalent to the corresponding backend - ✔ should parse secret - - addResourcesToBackend - ✔ should assert against impossible configurations - ✔ should handle a minimal https trigger - ✔ should handle a callable trigger - ✔ should handle a minimal task queue trigger - ✔ should copy fields - ✔ should rename/transform fields - ✔ should support explicit regions - ✔ should support multiple regions - ✔ should support schedules - ✔ should expand vpc connector setting to full resource name - ✔ should preserve empty vpc connector setting - ✔ should parse secret - ✔ should parse a basic blocking trigger - ✔ should parse a blocking trigger with options - should handle a minimal event trigger - ✔ should handle failurePolicy=undefined - ✔ should handle failurePolicy=false - ✔ should handle failurePolicy=true - ✔ should handle failurePolicy={"retry":{}} - - validate - packageJsonIsValid - ✔ should throw error if package.json file is missing - ✔ should throw error if functions source file is missing - ✔ should throw error if main is defined and that file is missing - ✔ should not throw error if runtime is set in the config and the engines field is not set - - checkFunctionsSDKVersion - ✔ Should warn if the SDK version is too low - ✔ Should not warn for the latest SDK version - ✔ Should give an upgrade warning - ✔ Should give a breaking change warning - - PythonDelegate - getPythonBinary - ✔ returns specific version of the python binary corresponding to the runtime - ✔ returns generic python binary given non-recognized python runtime - ✔ always returns version-neutral, python.exe on windows - - authBlocking - validateBlockingTrigger - ✔ should throw an error if more than one beforeCreate blocking endpoint - ✔ should throw an error if more than one beforeSignIn blocking endpoint - ✔ should not throw on valid blocking endpoints - registerBlockingTrigger - ✔ should handle an empty config - ✔ should register on a new beforeCreate endpoint - ✔ should register on a new beforeSignIn endpoint - ✔ should do not set the config if the config is unchanged - unregisterBlockingTrigger - ✔ should not unregister a beforeCreate endpoint if uri does not match - ✔ should not unregister a beforeSignIn endpoint if the uri does not match - ✔ should unregister a beforeCreate endpoint - ✔ should unregister a beforeSignIn endpoint - ✔ should unregister a beforeSignIn endpoint that was registered to both event types - - ensureDatabaseTriggerRegion - ✔ should set the trigger location to the function region - ✔ should not error if the trigger location is already set correctly - ✔ should error if the trigger location is set incorrectly - - ensureFirebaseAlertsTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - ensureFirestoreTriggerRegion - ✔ should throw an error if the trigger region is different than the firestore region - ✔ should not throw if the trigger region is not set - ✔ should not throw if the trigger region is set correctly - - ensureRemoteConfigTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - obtainStorageBindings - ✔ should return the correct storage binding - - ensureTestLabTriggerRegion - ✔ should set the trigger location to global - ✔ should not error if the trigger location is global - ✔ should error if the trigger location is not global - - TriggerRegionHelper - ensureTriggerRegions - ✔ should throw an error if we can't find the bucket region - ✔ should skip v1 and callable functions - ✔ should set trigger region from API - ✔ should set trigger region from API then reject on invalid function region - - validate - functionsDirectoryExists - ✔ should not throw error if functions directory is present - ✔ should throw error if the functions directory does not exist - functionNamesAreValid - ✔ should allow properly formatted function names - ✔ should throw error on improperly formatted function names - ✔ should throw error if some function names are improperly formatted - - should throw error on empty function names - ✔ should not throw error on capital letters in v2 function names - ✔ should not throw error on underscores in v2 function names - endpointsAreValid - ✔ disallows concurrency for GCF gen 1 - ✔ Disallows concurrency for low-CPU gen 2 - ✔ does not throw for valid CPU undefined - ✔ does not throw for valid CPU gcf_gen1 - ✔ does not throw for valid CPU 0.1 - ✔ does not throw for valid CPU 0.5 - ✔ does not throw for valid CPU 1 - ✔ does not throw for valid CPU 2 - ✔ does not throw for valid CPU 4 - ✔ does not throw for valid CPU 6 - ✔ does not throw for valid CPU 8 - ✔ throws for gcfv1 with CPU - ✔ disallows large CPU in low-CPU regionaustralia-southeast2 - ✔ disallows large CPU in low-CPU regionasia-northeast3 - ✔ disallows large CPU in low-CPU regionasia-south2 - ✔ allows valid CPU size 0.08 - ✔ allows valid CPU size 0.5 - ✔ allows valid CPU size 1 - ✔ allows valid CPU size 2 - ✔ allows valid CPU size 4 - ✔ allows valid CPU size 6 - ✔ allows valid CPU size 8 - ✔ allows valid CPU size gcf_gen1 - ✔ disallows CPU size 0.07 - ✔ disallows CPU size 1.1 - ✔ disallows CPU size 3 - ✔ disallows CPU size 5 - ✔ disallows CPU size 7 - ✔ disallows CPU size 9 - ✔ disallows tiny CPU with large memory - ✔ disallows small CPU with huge memory - ✔ enforces minimum memory for 4 CPU - ✔ enforces minimum memory for 6 CPU - ✔ enforces minimum memory for 8 CPU - ✔ allows gcfv2 endpoints with mem 128 and no cpu - ✔ allows gcfv2 endpoints with mem 256 and no cpu - ✔ allows gcfv2 endpoints with mem 512 and no cpu - ✔ allows gcfv2 endpoints with mem 1024 and no cpu - ✔ allows gcfv2 endpoints with mem 2048 and no cpu - ✔ allows gcfv2 endpoints with mem 4096 and no cpu - ✔ allows gcfv2 endpoints with mem 8192 and no cpu - ✔ allows gcfv2 endpoints with mem 16384 and no cpu - ✔ allows gcfv2 endpoints with mem 32768 and no cpu - ✔ allows endpoints with no mem and no concurrency - ✔ allows endpoints with mem and no concurrency - ✔ allows explicitly one concurrent - ✔ allows endpoints with enough mem and no concurrency - ✔ allows endpoints with enough mem and explicit concurrency - ✔ disallows concurrency with too little memory (implicit) - ✔ Disallows concurrency with too little cpu (explicit) - ✔ disallows multiple beforeCreate blocking - ✔ disallows multiple beforeSignIn blocking - ✔ Allows valid blocking functions - endpointsAreUnqiue - ✔ passes given unqiue ids - ✔ passes given unique id, region pairs - ✔ throws given non-unique id region pairs - ✔ throws given non-unique id region pairs across all codebases - ✔ throws given multiple conflicts - secretsAreValid - ✔ passes validation with empty backend - ✔ passes validation with no secret env vars - ✔ fails validation given non-existent secret version - ✔ fails validation given non-existent secret version - ✔ fails validation given disabled secret version - ✔ passes validation and resolves latest version given valid secret config - - convertConfig - ✔ returns rewrites for glob destination - ✔ returns rewrites for regex destination - ✔ checks for function region if unspecified - ✔ discovers the function region of a callable function - ✔ returns rewrites for glob CF3 - ✔ defaults to a us-central1 rewrite if one is avaiable, v1 edition - ✔ defaults to a us-central1 rewrite if one is avaiable, v2 edition - ✔ returns rewrites for regex CF3 - ✔ rewrites referencing CF3v2 functions being deployed are changed to Cloud Run (during release) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during prepare) - ✔ rewrites referencing existing CF3v2 functions are changed to Cloud Run (during release) - ✔ returns rewrites for glob Run - ✔ returns rewrites for regex Run - ✔ return rewrites for Cloud Run instances being deployed (during release) - ✔ returns the specified rewrite even if it's not found - ✔ returns rewrites for Run with specified regions - ✔ returns rewrites for glob Dynamic Links - ✔ returns rewrites for regex Dynamic Links - ✔ returns glob redirects without a specified code/type - ✔ returns regex redirects without a specified code/type - ✔ returns glob redirects with a specified code/type - ✔ returns no headers if they weren't specified - ✔ returns glob headers as a map - ✔ returns regex headers as a map - ✔ returns clean URLs when it is false - ✔ returns clean URLs when it is true - ✔ returns trailing slash as ADD when true - ✔ returns trailing slash as REMOVE when false - ✔ returns app association as it is set - ✔ returns i18n as it is set - ✔ rewrites v2 functions tags - ✔ rewrites run tags - rewrites errors - ✔ should throw when rewrite points to function in the wrong region (104ms) - ✔ should throw when rewrite points to function being deleted (52ms) - with permissions issues - ✔ should not throw when resolving backends - - hashcache - ✔ should return an empty object if a file doesn't exist - ✔ should be able to dump configuration to a file - ✔ should be able to load configuration from a file - - hosting prepare - ✔ passes a smoke test with web framework - ✔ passes a smoke test without web framework - unsafePins - ✔ does not care about modifying live (implicit) - ✔ does not care about modifying live (explicit) - ✔ does not care about already pinned rewrites (run) - ✔ does not care about already pinned rewrites (gcf) - ✔ rejects about newly pinned rewrites (run) - ✔ rejects about newly pinned rewrites (gcf) - hasPinnedFunctions - ✔ detects function tags - ✔ detects a lack of function tags - addPinnedFunctionsToOnlyString - ✔ adds functions to deploy targets w/ codebases - ✔ adds functions to deploy targets w/o codebases - ✔ doesn't add untagged functions - - release - with no Hosting deploys - ✔ should bail - a single site - ✔ should update a version and make a release - ✔ should update a version and make a release with a message - multiple sites - ✔ should update a version and make a release - to a hosting channel - ✔ should update a version and make a release - - Remote Config Deploy - Publish the updated template - ✔ should publish the latest template - ✔ should publish the latest template with * etag - ✔ should reject if the api call fails - - storage.release - ✔ should not release anything if there are no deployable configs - ✔ should release rules for a single deploy config - ✔ should release rules based on targets - - downloadToTmp - ✔ should download a file - ✔ should throw an error on non-200 code - - adminSdkConfig - getProjectAdminSdkConfigOrCached - ✔ should return a fake config for a demo project id - - Auth Emulator: accounts:batchGet - ✔ should allow listing all accounts - ✔ should return MFA info - ✔ should allow listing all accounts using legacy endpoint - ✔ should allow specifying maxResults and pagination - ✔ should always return a page token if page is full - ✔ should error if auth is disabled - - Auth Emulator: accounts:batchCreate - ✔ should create specified accounts - ✔ should create specified accounts via legacy endpoint - ✔ should error if users is empty or missing - ✔ should convert emails to lowercase - ✔ should accept Auth Emulator fake passwordHash from request - - should reject production passwordHash - ✔ should error for duplicate emails in payload if sanityCheck is true - ✔ should block reusing existing email if sanityCheck is true - ✔ should error for duplicate providerId+rawIds in payload if sanityCheck is true - ✔ should block reusing exisiting providerId+rawIds if sanityCheck is true - ✔ should block duplicate localIds by default - ✔ should not error for empty MFA info - ✔ should return error for individual invalid entries - ✔ should overwrite users with matching localIds if allowOverwrite - ✔ should import identity provider info - ✔ should import MFA info - ✔ should error if auth is disabled - ✔ should error if user tenantId does not match state tenantId - ✔ should create users with tenantId if present - - Auth Emulator: accounts:batchDelete - ✔ should delete specified disabled accounts - ✔ should error for accounts not disabled - ✔ should delete disabled and not disabled accounts with force: true - ✔ should not report errors for nonexistent localIds - ✔ should error if localIds array is empty - ✔ should error if localId count is more than limit - - cloudFunctions - dispatch - ✔ should make a request to the functions emulator - - Auth Emulator: config management - updateConfig - ✔ updates the project level config - ✔ does not update if the field does not exist on the update config - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - ✔ should error when updating an invalid blocking function event - ✔ should error if functionUri is invalid - getConfig - ✔ should return the project level config - ✔ should return updated config fields - - Auth Emulator: accounts:createAuthUri - ✔ should report not registered user as not registered - ✔ should return providers for a registered user - ✔ should return existing sessionId if provided - ✔ should find user by email ignoring case - ✔ should find user by either IDP email or 'top-level' email - ✔ should not list IDP sign-in methods when allowDuplicateEmails - ✔ should error if identifier or continueUri is not provided - ✔ should error if identifier is invalid - ✔ should error if continueUri is invalid - ✔ should error if auth is disabled - - Auth Emulator: sign-in with custom token - ✔ should create new account from custom token (unsigned) - ✔ should sign into existing account and merge claims - ✔ should error if custom token is missing - ✔ should error if custom token is invalid - ✔ should error if custom token addresses the wrong audience - ✔ should error if custom token contains no uid - ✔ should error if custom token contains forbidden claims - ✔ should error if user is disabled - ✔ should error if auth is disabled - ✔ should error if custom token tenantId does not match - ✔ should create a new account from custom token with tenantId - - Auth Emulator: accounts:delete - ✔ should delete the user of the idToken - ✔ should error when trying to delete by localId without OAuth - ✔ should remove federated accounts for user - ✔ should delete the user by localId if OAuth credentials are present - ✔ should error if missing localId when OAuth credentials are present - ✔ should delete the user of the idToken - - Auth Emulator: email link sign-in - ✔ should send OOB code to new emails and create account on sign-in - ✔ should sign an existing account in and enable email-link sign-in for them - ✔ should error on invalid oobCode - ✔ should error if user is disabled - ✔ should error if email mismatches - ✔ should link existing account with idToken to new email - ✔ should link existing phone-auth account to new email - ✔ should error when trying to link an email already used in another account - ✔ should error if user to be linked is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if email link sign in is disabled - ✔ should create account on sign-in with tenantId - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields for account creation - ✔ should pass user info in the request body to beforeCreate - ✔ should pass user info in the request body to beforeSignIn - ✔ should pass user info in the request body to beforeSignIn and include modifiable fields from beforeCreate - ✔ should update modifiable fields before sign in - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should update modifiable fields before sign in for existing accounts - ✔ should error after disabling user - - Auth Emulator: sign-in with credential - ✔ should create new account with IDP from unsigned ID token - ✔ should create new account with IDP from production ID token - ✔ should create new account with IDP from unencoded JSON claims - ✔ should accept params (e.g. providerId, id_token) in requestUri - ✔ should copy attributes to user on IDP sign-up - ✔ should allow duplicate emails if set in project config - ✔ should sign-up new users without copying email when allowing duplicate emails - ✔ should allow multiple providers with same email when allowing duplicate emails - ✔ should sign in existing account if (providerId, sub) is the same - ✔ should error if user is disabled - ✔ should add IDP as a sign-in method for email if available - ✔ should unlink password and overwite profile attributes if user had unverified email - ✔ should not unlink password if email was already verified - ✔ should return needConfirmation if both account and IDP has unverified email - ✔ should error when requestUri is missing or invalid - ✔ should error when missing providerId is missing - ✔ should error when sub is missing or not a string - ✔ should link IDP to existing account by idToken - ✔ should copy IDP email to user-level email if not present - ✔ should error if user to be linked is disabled - ✔ should return pending credential for MFA-enabled user - ✔ should link IDP for existing MFA-enabled user - ✔ should return error if IDP account is already linked to the same user - ✔ should return error if IDP account is already linked to another user - ✔ should return error if IDP account email already exists if NOT allowDuplicateEmail - ✔ should allow linking IDP account with same email to same user - ✔ should allow linking IDP account with same email if allowDuplicateEmail - ✔ should error if auth is disabled - ✔ should create a new account with tenantId - ✔ should return pending credential for MFA-enabled user and enabled on tenant project - ✔ should error if SAMLResponse is missing assertion - ✔ should error if SAMLResponse is missing assertion.subject - ✔ should error if SAMLResponse is missing assertion.subject.nameId - ✔ should create an account for generic SAML providers - ✔ should include fields in SAMLResponse for SAML providers - when blocking functions are present - ✔ should update modifiable fields for new users for beforeCreate - ✔ should update modifiable fields for new users for beforeSignIn - ✔ beforeSignIn fields should overwrite beforeCreate fields for new users - ✔ should update modifiable fields for existing users - ✔ should disable user if set - - Auth Emulator: mfa enrollment - ✔ should error if account does not have email verified - ✔ should allow phone enrollment for an existing account - ✔ should error if phoneEnrollmentInfo is not specified - ✔ should error if phoneNumber is invalid - ✔ should error if phoneNumber is a duplicate - ✔ should error if sign-in method of idToken is ineligible for MFA - ✔ should error on mfaEnrollment:start if auth is disabled - ✔ should error on mfaEnrollment:start if MFA is disabled - ✔ should error on mfaEnrollment:start if phone SMS is not an enabled provider - ✔ should error on mfaEnrollment:finalize if auth is disabled - ✔ should error on mfaEnrollment:finalize if MFA is disabled - ✔ should error on mfaEnrollment:finalize if phone SMS is not an enabled provider - ✔ should allow sign-in with pending credential for MFA-enabled user - ✔ should error on mfaSignIn:start if auth is disabled - ✔ should error on mfaSignIn:start if MFA is disabled - ✔ should error on mfaSignIn:start if phone SMS is not an enabled provider - ✔ should error on mfaSignIn:finalize if auth is disabled - ✔ should error on mfaSignIn:finalize if MFA is disabled - ✔ should error on mfaSignIn:finalize if phone SMS is not an enabled provider - ✔ should allow withdrawing MFA for a user - ✔ should error on mfaEnrollment:withdraw if auth is disabled - when blocking functions are present - ✔ mfaSignIn:finalize should update modifiable fields before sign in - ✔ mfaSignIn:finalize should disable user if set - - Auth Emulator: token refresh - ✔ should exchange refresh token for new tokens - ✔ should exchange refresh tokens for new tokens in a tenant project - ✔ should populate auth_time to match lastLoginAt (in seconds since epoch) - ✔ should error if grant type is missing - ✔ should error if grant type is not refresh_token - ✔ should error if refresh token is missing - ✔ should error on malformed refresh tokens - ✔ should error if user is disabled - ✔ should error when refresh tokens are from a different project - ✔ should error on refresh tokens without required fields - ✔ should error if the refresh token is for a user that does not exist - - Auth Emulator: createSessionCookie - ✔ should return a valid sessionCookie - ✔ should throw if idToken is missing - ✔ should throw if idToken is invalid - ✔ should use default session cookie validDuration if not specified - ✔ should throw if validDuration is too short or too long - - Auth Emulator: accounts:lookup - ✔ should return user by localId when privileged - ✔ should deduplicate users - ✔ should return providerUserInfo for phone auth users - ✔ should return empty result when localId is not found - ✔ should return user by tenantId in idToken - ✔ should error if auth is disabled - - Auth Emulator: accounts:query - ✔ should return count of accounts when returnUserInfo is false - ✔ should return accounts when returnUserInfo is true - ✔ should error if auth is disabled - - Auth Emulator: emulator utility APIs - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/accounts - ✔ should drop all accounts on DELETE /emulator/v1/projects/{PROJECT_ID}/tenants/{TENANT_ID}/accounts - ✔ should return config on GET /emulator/v1/projects/{PROJECT_ID}/config - ✔ should not throw an exception on project ID mismatch if singleProjectMode is NO_WARNING - ✔ should update allowDuplicateEmails on PATCH /emulator/v1/projects/{PROJECT_ID}/config - - Auth Emulator: emulator utility API; singleProjectMode=ERROR - ✔ should throw an exception on project ID mismatch if singleProjectMode is ERROR - - Auth Emulator: accounts:sendOobCode - ✔ should generate OOB code for verify email - ✔ should return OOB code directly for requests with OAuth 2 - ✔ should return OOB code by idToken for OAuth 2 requests as well - ✔ should error when trying to verify email without idToken or email - ✔ should error when trying to verify email without idToken if not returnOobLink - ✔ should error when trying to verify email not associated with any user - ✔ should error when verifying email for accounts without email - ✔ should error if user is disabled - ✔ should error when continueUrl is invalid - ✔ should error if auth is disabled - ✔ should error for email sign in if not enabled - ✔ should generate OOB code for reset password - ✔ should return purpose of oobCodes via resetPassword endpoint - ✔ should error on resetPassword if auth is disabled - ✔ should error on resetPassword if password sign up is disabled - - Auth Emulator: accounts:signInWithPassword - ✔ should issue tokens when email and password are valid - ✔ should update lastLoginAt on successful login - ✔ should validate email address ignoring case - ✔ should error if email or password is missing - ✔ should error if email is invalid - ✔ should error if email is not found - ✔ should error if password is wrong - ✔ should error if user is disabled - ✔ should return pending credential if user has MFA - ✔ should error if auth is disabled - ✔ should error if password sign up is disabled - ✔ should return pending credential if user has MFA and enabled on tenant projects - when blocking functions are present - ✔ should update modifiable fields before sign in - ✔ should disable user if set - ✔ should not trigger blocking function if user has MFA - - Auth Emulator: phone auth sign-in - ✔ should return fake recaptcha params - ✔ should pretend to send a verification code via SMS - ✔ should error when phone number is missing when calling sendVerificationCode - ✔ should error when phone number is invalid - ✔ should error on sendVerificationCode if auth is disabled - ✔ should error on sendVerificationCode for tenant projects - ✔ should create new account by verifying phone number - ✔ should error when sessionInfo or code is missing for signInWithPhoneNumber - ✔ should error when sessionInfo or code is invalid - ✔ should error if user is disabled - ✔ should link phone number to existing account by idToken - ✔ should error if user to be linked is disabled - ✔ should error when linking phone number to existing user with MFA - ✔ should error if user has MFA - ✔ should return temporaryProof if phone number already belongs to another account - ✔ should error if auth is disabled - ✔ should error if called on tenant project - when blocking functions are present - ✔ should update modifiable fields for new users - ✔ should update modifiable fields for existing users - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable user if set - - Auth Emulator: REST API mapping - ✔ should respond to status checks - ✔ should allow cross-origin requests - ✔ should handle integer values for enums - ✔ should handle integer values for enums (legacy API path) - ✔ should convert numbers to strings for type:string fields - - Auth Emulator: authentication - ✔ should throw 403 if API key is not provided - ✔ should accept API key as a query parameter - ✔ should accept API key in HTTP Header x-goog-api-key - ✔ should ignore non-Bearer Authorization headers - ✔ should treat Bearer owner as authenticated to project - ✔ should ignore casing of Bearer / owner in Authorization header - ✔ should treat production service account as authenticated to project - ✔ should deny requests with targetProjectId but without OAuth 2 - ✔ should deny requests where tenant IDs do not match in the request body and path - ✔ should deny requests where tenant IDs do not match in the ID token and path - ✔ should deny requests where tenant IDs do not match in the ID token and request body - - Auth Emulator: accounts:update - ✔ should allow updating and deleting displayName and photoUrl - ✔ should set password and issue new tokens - ✔ should add password provider to anon user - ✔ should allow adding email without password to anon user - ✔ should allow changing email of an existing user, and send out an oob to reset the email - ✔ should disallow setting email to same as an existing user - ✔ should set initialEmail for the user, after updating email - ✔ should reset email when OOB flow is initiated, after updating user email - ✔ should disallow resetting an email if another user exists with the same email - ✔ should not set initial email or send OOB when anon user updates email - ✔ should not update email if user is disabled - ✔ should update phoneNumber if specified - ✔ should noop when setting phoneNumber to the same as before - ✔ should disallow setting phone to same as an existing user - ✔ should error if phoneNumber is invalid - ✔ should allow creating MFA info - ✔ should allow adding a second MFA factor - ✔ should allow changing the MFA phone number - ✔ should allow changing the MFA enrollment ID - ✔ should overwrite existing MFA info - ✔ should remove MFA info with an empty enrollments array - ✔ should remove MFA info with an undefined enrollments array - ✔ should error if mfaEnrollmentId is absent - ✔ should de-duplicate MFA factors with the same phone number - ✔ should error if MFA Enrollment ID is duplicated for different phone numbers - ✔ does not require MFA Enrollment ID uniqueness across users - ✔ should error if phone number for MFA is invalid - ✔ should error if user for MFA update is not found - ✔ should error if enrollments is not an array or undefined - ✔ should error if user is disabled when updating by idToken - ✔ should still update user despite user is disabled when authenticated - ✔ should invalidate old tokens after updating validSince or password - ✔ should delete password provider from user - ✔ should delete phone provider from user - ✔ should delete google.com provider from user - ✔ should update user by localId when authenticated - ✔ should error if authenticated request does not specify localId - ✔ should update customAttributes and add them to ID Tokens - ✔ should error if customAttributes are invalid - ✔ should error if auth is disabled - ✔ should set tenantId in oobLink - - Auth Emulator: accounts:signUp - ✔ should throw error if no email provided - ✔ should throw error if empty email and password is provided - ✔ should issue idToken and refreshToken on anon signUp - ✔ should issue refreshToken on email+password signUp - ✔ should ignore displayName and photoUrl for new anon account - ✔ should set displayName but ignore photoUrl for new password account - ✔ should disallow duplicate email signUp - ✔ should error if another account exists with same email from IDP - ✔ should error when email format is invalid - ✔ should normalize email address to all lowercase - ✔ should error when password is too short - ✔ should error when idToken is provided but email / password is not - ✔ should link email and password to anon user if idToken is provided - ✔ should link email and password to phone sign-in user - ✔ should error if account to be linked is disabled - ✔ should replace existing email / password in linked account - ✔ should create new account with phone number when authenticated - ✔ should error when extra localId parameter is provided - ✔ should create new account with specified localId when authenticated - ✔ should error when creating new user with duplicate localId - ✔ should error if phone number is invalid - ✔ should create new account with multi factor info - ✔ should create new account with two MFA factors - ✔ should de-duplicate factors with the same info on create - ✔ does not require a display name for multi factor info - ✔ should error if multi factor phone number is invalid - ✔ should ignore if multi factor enrollment ID is specified on create - ✔ should error if auth is disabled - ✔ should error if password sign up is not allowed - ✔ should error if anonymous user is disabled - ✔ should create new account with tenant info - when blocking functions are present - ✔ should update modifiable fields with beforeCreate response for a new email/password user - ✔ should update modifiable fields with beforeSignIn response for a new email/password user - ✔ beforeSignIn fields should overwrite beforeCreate fields - ✔ should disable new user if set - ✔ should not trigger blocking functions for privileged requests - - Auth Emulator: tenant management - createTenant - ✔ should create tenants - ✔ should create a tenant with default disabled settings - getTenants - ✔ should get tenants - ✔ should create tenants with default enabled settings if they do not exist - deleteTenants - ✔ should delete tenants - ✔ should delete tenants if request body is passed - listTenants - ✔ should list tenants - ✔ should allow specifying pageSize and pageToken - ✔ should always return a page token even if page is full - updateTenants - ✔ updates tenant config - ✔ does not update if the field does not exist on the update tenant - ✔ does not update if indexing a primitive field or array on the update tenant - ✔ performs a full update if the update mask is empty - ✔ performs a full update with production defaults if the update mask is empty - - commandUtils - ✔ Should disallow the user to set the current folder (ex: .) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: ./) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack/firebase-tools) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents/firestack) as --export-on-exit option - ✔ Should disallow the user to set the current folder (ex: /Users/svnsairam/Documents) as --export-on-exit option - ✔ Should disallow the user to set the current folder via the --import flag - ✔ should validate --export-on-exit options - ✔ should delete the --import option when the dir does not exist together with --export-on-exit - ✔ should not touch the --import option when the dir does not exist but --export-on-exit is not set - ✔ should keep other unrelated options when using setExportOnExitOptions - Mocked path resolve - ✔ Should not block if destination contains a match to the CWD - - EmulatorController - ✔ should start and stop an emulator (74ms) - - Resolver - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupFirst - ✔ should return the first value of result - ✔ should prefer IPv4 addresss using the underlying lookup - ✔ should return cached result if available - ✔ should pre-populate localhost in cache to resolve to IPv4 loopback address - ✔ should parse and return IPv4 addresses without lookup - ✔ should parse and return IPv6 addresses without lookup - #lookupAll - ✔ should return all addresses returned - ✔ should request IPv4 addresses to be listed first using the underlying lookup - ✔ should return cached results if available - ✔ should pre-populate localhost in cache to resolve to IPv4 + IPv6 loopback addresses (in that order) - - downloadDetails - ✔ should match the basename of remoteUrl - - eventarcEmulatorUtils - cloudEventFromProtoToJson - ✔ converts cloud event from proto format - ✔ throws invalid argument when source not set - ✔ populates converts object data to JSON and sets datacontenttype - ✔ populates string data and sets datacontenttype - ✔ allows optional attribute to not be set - - replaceConsoleLinks - ✔ should replace Firestore links - ✔ should replace Functions links - ✔ should replace Extensions links - ✔ should replace RTDB links - ✔ should replace Auth links - ✔ should replace multiple GAIA user links - ✔ should replace multiple links - ✔ should not replace other links - - ExtensionsEmulator validation - getUnemulatedAPIs - ✔ should check only unemulated APIs - ✔ should not check on demo- projects - checkForUnemulatedTriggerTypes - ✔ should return trigger types for emulators that are not running - ✔ should return trigger types that don't have an emulator - ✔ should not return duplicates - ✔ should not return trigger types for emulators that are running - ✔ should not return trigger types for https triggers - - Extensions Emulator - toEmulatableBackends - ✔ should transform a instance spec to a backend - installAndBuildSourceCode - ✔ installs dependecies (8598ms) - - FunctionsEmulatorShared - getFunctionService - ✔ should get service from event trigger definition - ✔ should infer https service from http trigger - ✔ should infer pubsub service based on eventType - ✔ should infer firestore service based on eventType - ✔ should infer database service based on eventType - ✔ should infer storage service based on eventType - ✔ should infer auth service based on eventType - getSecretLocalPath - ✔ should return the correct location for an Extension backend - ✔ should return the correct location for a CF3 backend - toBackendInfo - ✔ should transform a published Extension backend - ✔ should transform a local Extension backend - ✔ should transform a CF3 backend - ✔ should add secretEnvVar into env - - FunctionsEmulatorUtils - extractParamsFromPath - ✔ should match a path which fits a wildcard template - ✔ should not match unfilled wildcards - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - isValidWildcardMatch - ✔ should match a path which fits a wildcard template - ✔ should not match a path which is too long - ✔ should not match a path which is too short - ✔ should not match a path which has different chunks - trimSlashes - ✔ should remove leading and trailing slashes - ✔ should replace multiple adjacent slashes with a single slash - ✔ should do both - compareVersonStrings - ✔ should detect a higher major version - ✔ should detect a higher minor version - ✔ should detect a higher patch version - ✔ should detect the same version - parseRuntimeVerson - ✔ should parse fully specified runtime strings - ✔ should parse plain number strings - ✔ should ignore unknown - isLocalHost - ✔ should return true for localhost - ✔ should return true for 127.0.0.1 - ✔ should return true for ipv6 loopback - ✔ should work with https - ✔ should return false for external uri - ✔ should return false for external ip - - FunctionsRuntimeWorker - RuntimeWorker - ✔ goes from created --> idle --> busy --> idle in normal operation - ✔ goes from created --> idle --> busy --> finished when there's an error - ✔ goes from created --> busy --> finishing --> finished when marked - RuntimeWorkerPool - ✔ properly manages a single worker - ✔ does not consider failed workers idle - ✔ exit() kills idle and busy workers - ✔ refresh() kills idle workers and marks busy ones as finishing - ✔ gives assigns all triggers to the same worker in sequential mode - - EmulatorRegistry - ✔ should not report any running emulators when empty - ✔ should correctly return information about a running emulator (92ms) - ✔ once stopped, an emulator is no longer running (78ms) - #url - ✔ should craft URL from host and port in registry (75ms) - ✔ should quote IPv6 addresses (76ms) - ✔ should use 127.0.0.1 instead of 0.0.0.0 (76ms) - ✔ should use ::1 instead of :: (162ms) - ✔ should use protocol from request if available (75ms) - ✔ should use host from request if available (77ms) - - crc - ✔ correctly computes crc32c from a string - ✔ correctly computes crc32c from bytes - ✔ correctly stringifies crc32c - - files - ✔ can serialize and deserialize metadata - ✔ converts non-string custom metadata to string - StorageLayer - #uploadObject() - ✔ should throw if upload is not finished - ✔ should throw if upload is not authorized - #getObject() - ✔ should return data and metadata - ✔ should throw an error if request is not authorized - ✔ should throw an error if the object does not exist - - toSerializedDate - ✔ correctly serializes date - ✔ correctly serializes date with different timezone - - Storage Multipart Request Parser - #parseObjectUploadMultipartRequest() - ✔ parses an upload object multipart request successfully - ✔ parses an upload object multipart request with non utf-8 data successfully - ✔ parses an upload object multipart request with lowercase content-type - ✔ fails to parse with invalid Content-Type value - ✔ fails to parse with invalid boundary value - ✔ parses an upload object multipart request with additional quotes in the boundary value - ✔ fails to parse when body has wrong number of parts - ✔ fails to parse when body part has invalid content type - ✔ fails to parse when body part is malformed - - Persistence - #deleteFile() - ✔ should delete files - #readBytes() - ✔ should read existing files - ✔ should handle really long filename read existing files - #copyFromExternalPath() - ✔ should copy files existing files - - Storage Rules Config - ✔ should parse rules config for single target - ✔ should use default config for project IDs using demo- prefix if no rules file exists - ✔ should use provided config for project IDs using demo- prefix if the provided config exists - ✔ should parse rules file for multiple targets - ✔ should throw FirebaseError when storage config is missing - ✔ should throw FirebaseError when rules file is missing - ✔ should throw FirebaseError when rules file is invalid - - WorkQueue - mode=AUTO - ✔ never runs a job immediately - ✔ runs two jobs - ✔ never runs more than the maximum allowed parallel work (116ms) - mode=SEQUENTIAL - ✔ finishes one job before running another (122ms) - ✔ proceeds even if a job errors out - - ensureApiEnabled - check - ✔ should call the API to check if it's enabled - ✔ should return the value from the API - ensure - ✔ should verify that the API is enabled, and stop if it is - ✔ should attempt to enable the API if it is not enabled - ✔ should retry enabling the API if it does not enable in time - - error - FirebaseError - ✔ should be an instance of Error - ✔ should apply default options - ✔ should persist all options - - experiments - enableExperimentsFromCliEnvVariable - ✔ should enable some experiments - - checkAllowedEventTypesResponse - ✔ should return false if allowed events is not part of extension spec's events list - ✔ should return true if every allowed event exists in extension spec's events list - - askForAllowedEventTypes - ✔ should keep prompting user until valid input is given - - askForEventarcLocation - ✔ should keep prompting user until valid input is given - - askUserForParam - checkResponse - ✔ should return false if required variable is not set - ✔ should return false if regex validation fails - ✔ should return false if regex validation fails on an optional param that is not empty - ✔ should return true if no value is passed for an optional param - ✔ should not check against list of options if no value is passed for an optional SELECT - ✔ should not check against list of options if no value is passed for an optional MULTISELECT - ✔ should use custom validation error message if provided - ✔ should return true if all conditions pass - ✔ should return false if an invalid choice is selected - ✔ should return true if an valid choice is selected - ✔ should return false if multiple invalid choices are selected - ✔ should return true if one valid choice is selected - ✔ should return true if multiple valid choices are selected - getInquirerDefaults - ✔ should return the label of the option whose value matches the default - ✔ should return the value of the default option if it doesnt have a label - ✔ should return an empty string if a default option is not found - askForParam with string param - ✔ should keep prompting user until valid input is given - askForParam with secret param - ✔ should return the correct user input for secret stored with Secret Manager - ✔ should return the correct user input for secret stored in a local file - ✔ should handle cloud & local secret storage at the same time - ask - ✔ should call substituteParams with the right parameters - - billingMigrationHelper - displayNode10CreateBillingNotice - ✔ should notify the user if the runtime requires nodejs10 - ✔ should notify the user if the runtime does not require nodejs (explicit) - ✔ should notify the user if the runtime does not require nodejs (implicit) - ✔ should error if the user doesn't give consent - - changelog - GetReleaseNotesForUpdate - ✔ should return release notes for each version in the update - ✔ should exclude versions that don't have releaseNotes - breakingChangesInUpdate - ✔ should return no breaking changes - ✔ should return prerelease breaking change - ✔ should return breaking change - ✔ should return multiple breaking changes - parseChangelog - ✔ should split changelog by version - ✔ should ignore text not in a version - ✔ should handle prerelease versions - - checkProjectBilling - ✔ should resolve if billing enabled - ✔ should list accounts if no billing account set, but accounts available. - ✔ should not list accounts if no billing accounts set or available. - - diagnose - ✔ should succeed when IAM policy is correct (no fix) - ✔ should fail when project IAM policy missing extensions service agent (no fix) - ✔ should fix the project IAM policy by adding missing bindings - - displayExtensionInfo - displayExtInfo - ✔ should display info during install - ✔ should display additional information for a published extension - ✔ should display role and api for Cloud Tasks during install - ✔ should display role for Cloud Secret Manager during install - - optionsHelper - getParams - ✔ should return user and autopopulated params - ✔ should subsitute into params that reference other params - ✔ should fallback to defaults if a value isn't provided - getNonSecretEnv - ✔ should return only params that are not secret - getSecretEnv - ✔ should return only params that are secret - - getRuntime - ✔ gets runtime of resources - ✔ chooses the latest runtime if many runtime exists - ✔ returns default runtime if none specified - ✔ returns default runtime given no resources - ✔ throws error given invalid runtime - - triggerHelper - functionResourceToEmulatedTriggerDefintion - ✔ should assign valid properties from the resource to the ETD and ignore others - ✔ should handle HTTPS triggers - ✔ should handle firestore triggers - ✔ should handle database triggers - ✔ should handle pubsub triggers - ✔ should handle scheduled triggers - ✔ should handle v2 custom event triggers - ✔ should handle fully packed v2 triggers - ✔ should correctly inject system params - - detectEtagChanges - ✔ should not detect changes if there is no previously saved etags - ✔ should detect changes if a new instance was installed out of band - ✔ should detect changes if an instance was changed out of band - ✔ should detect changes if an instance was deleted out of band - - ext:export helpers - parameterizeProject - ✔ should strip projectId - ✔ should strip projectNumber - ✔ should not affect other params - setSecretVersionsToLatest - ✔ Should set active secrets to latest - - extensions - listInstances - ✔ should return a list of installed extensions instances - ✔ should query for more installed extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - createInstance - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given a source - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation when given an Extension ref - ✔ should make a POST and not poll if validateOnly=true - ✔ should throw a FirebaseError if create returns an error response - configureInstance - ✔ should make a PATCH call to the correct endpoint, and then poll on the returned operation (510ms) - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - deleteInstance - ✔ should make a DELETE call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if delete returns an error response - updateInstance - ✔ should include config.params in updateMask is params are changed - ✔ should not include config.params or config.system_params in updateMask is params aren't changed - ✔ should include config.system_params in updateMask if system_params are changed - ✔ should include config.allowed_event_types and config.eventarc_Channel in updateMask if events config is provided - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should make a PATCH and not poll if validateOnly=true - ✔ should throw a FirebaseError if update returns an error response - getInstance - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - getSource - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - createSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if create returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - extensionsHelper - ✔ should support both ${PARAM_NAME} AND ${param:PARAM_NAME} syntax - substituteParams - ✔ should substitute env variables - getDBInstanceFromURL - ✔ returns the correct instance name - populateDefaultParams - ✔ should set default if default is available - ✔ should throw error if no default is available - validateCommandLineParams - ✔ should throw error if param variable value is invalid - ✔ should throw error if # commandLineParams does not match # env vars from extension.yaml - ✔ should throw an error if a required param is missing - ✔ should not throw a error if a non-required param is missing - ✔ should not throw a regex error if a non-required param is missing - ✔ should throw a error if a param value doesn't pass the validation regex - ✔ should throw a error if a multiselect value isn't an option - ✔ should throw a error if a multiselect param is missing options - ✔ should throw a error if a select param is missing options - ✔ should not throw if a select value is an option - ✔ should not throw if all multiselect values are options - validateSpec - ✔ should not error on a valid spec - ✔ should error if license is missing - ✔ should error if license is invalid - ✔ should error if name is missing - ✔ should error if specVersion is missing - ✔ should error if version is missing - ✔ should error if a resource is malformed - ✔ should error if an api is malformed - ✔ should error if a param is malformed - ✔ should error if a STRING param has options. - ✔ should error if a select param has validationRegex. - ✔ should error if a param has an invalid type. - ✔ should error if a param selectResource missing resourceType. - promptForValidInstanceId - ✔ should prompt the user and return if the user provides a valid id - ✔ should prompt the user again if the provided id is shorter than 6 characters - ✔ should prompt the user again if the provided id is longer than 45 characters - ✔ should prompt the user again if the provided id ends in a - - ✔ should prompt the user again if the provided id starts with a number - ✔ should prompt the user again if the provided id contains illegal characters - createSourceFromLocation - ✔ should upload local sources to Firebase Storage then create an ExtensionSource - ✔ should succeed even when it fails to delete the uploaded archive - ✔ should throw an error if one is thrown while uploading a local source - checkIfInstanceIdAlreadyExists - ✔ should return false if no instance with that name exists - ✔ should return true if an instance with that name exists - ✔ should throw if it gets an unexpected error response from getInstance - getFirebaseProjectParams - ✔ should not call prodution when using a demo- project in emulator mode - ✔ should return real values for non 'demo-' projects - getNextVersionByStage - ✔ should return expected stages and versions - ✔ should ignore unknown stages and different prerelease format - unpackExtensionState - ✔ should return correct published state - ✔ should return correct uploaded state - ✔ should return correct deprecated state - ✔ should return correct suspended state - ✔ should return correct prerelease state - canonicalizeRefInput - ✔ should do nothing to a valid ref - ✔ should infer latest version - ✔ should infer publisher name as firebase - ✔ should infer publisher name as firebase and also infer latest as version - - listExtensions - ✔ should return an empty array if no extensions have been installed - ✔ should return a sorted array of extension instances - - localHelper - getLocalExtensionSpec - ✔ should return a spec when extension.yaml is present - ✔ should populate preinstallContent when PREINSTALL.md is present - ✔ should return a nice error if there is no extension.yaml - with an invalid YAML file - ✔ should return a rejected promise with a useful error if extension.yaml is invalid - other YAML errors - ✔ should rethrow normal errors - isLocalExtension - ✔ should return true if a file exists there - ✔ should return false if a file doesn't exist there - - manifest - instanceExists - ✔ should return true for an existing instance - ✔ should return false for a non-existing instance - getInstanceTarget - ✔ should return the correct source for a local instance - ✔ should return the correct source for an instance with ref - ✔ should throw when looking for a non-existing instance - getInstanceRef - ✔ should return the correct ref for an existing instance - ✔ should throw when looking for a non-existing instance - ✔ should throw when looking for a instance with local source - removeFromManifest - ✔ should remove from firebase.json and remove .env file - writeToManifest - ✔ should write to both firebase.json and env files - ✔ should write to env files in stable, alphabetical by key order - ✔ should write events-related env vars - ✔ should overwrite when user chooses to - ✔ should not write empty values - writeLocalSecrets - ✔ should write all secret params that have local values - ✔ should write only secret with local values - ✔ should write only local values that are ParamType.SECRET - ✔ should not write the file if there's no matching params - readParams - ✔ should read from generic .env file - ✔ should read from project id .env file - ✔ should read from project number .env file - ✔ should read from an alias .env file - ✔ should prefer values from project specific env files - - metricsUtil - parseBucket - ✔ should parse a bucket based on the higher bound value - buildMetricsTableRow - ✔ shows decreasing instance count properly - ✔ shows decreasing instance count properly - parseTimeseriesResponse - ✔ should parse TimeSeriesResponse into list of BucketedMetrics - - paramHelper - getBaseParamBindings - ✔ should extract the baseValue param bindings - buildBindingOptionsWithBaseValue - ✔ should build given baseValue values - getParams - ✔ should prompt the user for params - getParamsWithCurrentValuesAsDefaults - ✔ should change existing defaults to the current state and leave other values unchanged - promptForNewParams - ✔ should prompt the user for any params in the new spec that are not in the current one - ✔ should prompt for params that are not currently populated - ✔ should not prompt the user for params that did not change type or param - ✔ should populate the spec with the default value if it is returned by prompt - ✔ shouldn't prompt if there are no new params - ✔ should exit if a prompt fails - - provisioningHelper - getUsedProducts - ✔ returns empty array when nothing is used - ✔ returns STORAGE when Storage API is used - ✔ returns STORAGE when Storage Role is used - ✔ returns STORAGE when Storage trigger is used - ✔ returns AUTH when Authentication API is used - ✔ returns AUTH when Authentication Role is used - ✔ returns AUTH when Auth trigger is used - checkProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no firebase storage buckets - ✔ fails provisioning check storage when no auth is not provisioned - bulkCheckProductsProvisioned - ✔ passes provisioning check status when nothing is used - ✔ passes provisioning check when all is provisioned - ✔ checks all products for multiple versions - ✔ fails provisioning check storage when default bucket is not linked - ✔ fails provisioning check storage when no auth is not provisioned - - createExtensionVersionFromGitHubSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - createExtensionVersionFromLocalSource - ✔ should make a POST call to the correct endpoint, and then poll on the returned operation - ✔ should throw a FirebaseError if createExtensionVersionFromLocalSource returns an error response - ✔ stop polling and throw if the operation call throws an unexpected error - ✔ should throw an error for an invalid ref - - getExtension - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - getExtensionVersion - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - ✔ should throw an error for an invalid ref - - listExtensions - ✔ should return a list of published extensions - ✔ should return a list of all extensions - ✔ should query for more extensions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - - listExtensionVersions - ✔ should return a list of published extension versions - ✔ should send filter query param - ✔ should return a list of all extension versions - ✔ should query for more extension versions if the response has a next_page_token - ✔ should throw FirebaseError if any call returns an error - ✔ should throw an error for an invalid ref - - getPublisherProfile - ✔ should make a GET call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - registerPublisherProfile - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - deprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - undeprecateExtensionVersion - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - secretsUtils - getManagedSecrets - ✔ only returns secrets that have labels set - - tos - ✔ should return the latest publisher TOS is it has already been accepted - getAppDeveloperTOSStatus - ✔ should get app developer TOS - getPublisherTOS - ✔ should get publisher TOS - acceptAppDeveloperTOS - ✔ should accept app dev TOS with no instance - ✔ should accept app dev TOS with an instance - acceptPublisherTOS - ✔ should accept publisher TOS - acceptLatestAppDeveloperTOS - ✔ should prompt to accept the latest app dev TOS if it has not been accepted - ✔ should not prompt for the latest app dev TOS if it has already been accepted - ✔ should accept the TOS once per instance - acceptLatestPublisherTOS - ✔ should prompt to accept the latest publisher TOS if it has not been accepted - - updateHelper - updateFromLocalSource - ✔ should return the correct source name for a valid local source - ✔ should throw an error for an invalid source - updateFromUrlSource - ✔ should return the correct source name for a valid url source - ✔ should throw an error for an invalid source - - inferUpdateSource - ✔ should infer update source from ref without version - ✔ should infer update source from ref with just version - ✔ should infer update source from ref and extension name - ✔ should infer update source if it is a ref distinct from the input ref - - getExistingSourceOrigin - ✔ should return published extension as source origin - ✔ should return local extension as source origin - - extensions utils - formatTimestamp - ✔ should format timestamp correctly - - displayWarningsForDeploy - ✔ should not warn if published - ✔ should not warn if not published - - fetchWebSetup module - fetchWebSetup - ✔ should fetch the web app config - ✔ should store the fetched config - ✔ should throw an error if the request fails - ✔ should return a fake config for a demo project id - getCachedWebSetup - ✔ should return no config if none is cached - ✔ should return a stored config - - filterTargets - ✔ should leave targets alone if no filtering is specified - ✔ should filter targets from --only - ✔ should filter out targets with --except - - firebaseConfigValidate - ✔ should accept a basic, valid config - ✔ should report an extra top-level field - ✔ should report a missing required field - ✔ should report a field with an incorrect type - - encodeFirestoreValue - ✔ should encode known types - ✔ should throw an error with unknown types - - IndexValidation - ✔ should accept a valid v1beta2 index spec - ✔ should not change a valid v1beta2 index spec after upgrade - ✔ should accept an empty spec - ✔ should accept a valid v1beta1 index spec after upgrade - ✔ should reject an incomplete index spec - ✔ should reject an overspecified index spec - - IndexSpecMatching - ✔ should identify a positive index spec match - ✔ should identify a negative index spec match - ✔ should identify a positive field spec match - ✔ should identify a positive field spec match with ttl specified as false - ✔ should identify a positive ttl field spec match - ✔ should identify a negative ttl field spec match - ✔ should match a field spec with all indexes excluded - ✔ should match a field spec with only ttl - ✔ should identify a negative field spec match - ✔ should identify a negative field spec match with ttl as false - - IndexSorting - ✔ should be able to handle empty arrays - ✔ should correctly sort an array of Spec indexes - ✔ should correcty sort an array of Spec field overrides - ✔ should sort ttl true to be last in an array of Spec field overrides - ✔ should correctly sort an array of API indexes - ✔ should correctly sort an array of API field overrides - - IndexNameParsing - ✔ should parse an index name correctly - ✔ should parse a field name correctly - ✔ should parse an index name from a named database correctly - ✔ should parse a field name from a named database correctly - - Angular - discovery - ✔ should find an Angular app - - Astro - discovery - ✔ should find a static Astro app - ✔ should find an Astro SSR app - ɵcodegenPublicDirectory - ✔ should copy over a static Astro app - ✔ should copy over an Astro SSR app - ɵcodegenFunctionsDirectory - ✔ should copy over the cloud function - build - ✔ should build an Astro SSR app - ✔ should fail to build an Astro SSR app w/wrong adapter - ✔ should build an Astro static app - getDevModeHandle - 🚀 astro v2.2.2 started in 64ms - - ┃ Local http://localhost:3000/ - ┃ Network use --host to expose - - ✔ should resolve with dev server output - - RepositoryFileSystem - exists - ✔ should return true if file exists in the directory - ✔ should return false if file does not exist in the directory - read - ✔ should read and return the contents of the file - - frameworkMatcher - frameworkMatcher - ✔ should return express FrameworkSpec after analysing express application - removeEmbededFrameworks - ✔ should return frameworks after removing embeded frameworks - filterFrameworksWithFiles - ✔ should return frameworks having all the required files - filterFrameworksWithDependencies - ✔ should return frameworks having required dependencies with in the project dependencies - - DockerfileBuilder - from - ✔ should add a FROM instruction to the Dockerfile - ✔ should add a FROM instruction to the Dockerfile without a name - fromLastStage - ✔ should add a FROM instruction to the Dockerfile using the last stage name - tempFrom - ✔ should add a FROM instruction without updating last stage - workdir - ✔ should add a WORKDIR instruction to the Dockerfile - run - ✔ should add a RUN instruction to the Dockerfile - cmd - ✔ should add a CMD instruction to the Dockerfile - copyForFirebase - ✔ should add a COPY instruction to the Dockerfile - copyFrom - ✔ should add a COPY instruction to the Dockerfile - env - ✔ should add an ENV instruction to the Dockerfile - envs - ✔ should add multiple ENV instructions to the Dockerfile - - genHookScript - ✔ generates executable script from anonymous functions - ✔ generates executable script from a named function - ✔ generates executable script from an object method - - Flutter - discovery - ✔ should discover - ✔ should not discover, if missing files - ✔ should not discovery, not flutter - ɵcodegenPublicDirectory - ✔ should copy over the web dir - build - ✔ should build - init - ✔ should create a new project - - Flutter utils - assertFlutterCliExists - ✔ should return void, if !status - - Next.js utils - ✔ should allow supported rewrites - cleanEscapedChars - ✔ should clean escaped chars - isRedirectSupportedByFirebase - ✔ should allow supported redirects - isHeaderSupportedByFirebase - ✔ should allow supported headers - getNextjsRewritesToUse - ✔ should use only beforeFiles - ✔ should return all rewrites if in array format - usesAppDirRouter - ✔ should return false when app dir doesn't exist - ✔ should return true when app dir does exist - usesNextImage - ✔ should return true when export marker has isNextImageImported - ✔ should return false when export marker has !isNextImageImported - hasUnoptimizedImage - ✔ should return true when images manfiest indicates unoptimized - ✔ should return true when images manfiest indicates !unoptimized - isUsingMiddleware - ✔ should return true if using middleware in development - ✔ should return false if not using middleware in development - ✔ should return true if using middleware in production - ✔ should return false if not using middleware in production - isUsingImageOptimization - ✔ should return true if images optimization is used - ✔ should return false if isNextImageImported is false - ✔ should return false if `unoptimized` option is used - isUsingAppDirectory - ✔ should return true if app-path-routes-manifest.json exists - ✔ should return false if app-path-routes-manifest.json did not exist - cleanCustomRouteI18n - ✔ should remove Next.js i18n prefix - allDependencyNames - ✔ should return empty on stopping conditions - ✔ should return expected dependency names - getMiddlewareMatcherRegexes - ✔ should return regexes when using version 1 - ✔ should return empty array when using version 1 but not using middleware - ✔ should return regexes when using version 2 - ✔ should return empty array when using version 2 but not using middleware - getNonStaticRoutes - ✔ should get non-static routes - getNonStaticServerComponents - ✔ should get non-static server components - getHeadersFromMetaFiles - ✔ should get headers from meta files - - Nuxt 2 utils - nuxtAppDiscovery - ✔ should find a Nuxt 2 app - ✔ should find a Nuxt 3 app - getDevModeHandle -Nuxi 3.0.0 - - WARN Changing NODE_ENV from production to development, to avoid unintended behavior. - - Nuxt 3.0.0 with Nitro 1.0.0 - - > Local: http://localhost:3000/ - > Network: http://0.0.0.0:3000/ - > Network: http://[some:ipv6::::::]:3000/ - > Network: http://[some:other:ipv6:::::]:3000/ ✔ should resolve with initial Nuxt 3 dev server output - - Frameworks utils - getNodeModuleBin - ✔ should return expected tsc path (255ms) - ✔ should throw when npm root not found (258ms) - ✔ should throw when executable not found (250ms) - isUrl - ✔ should identify http URL - ✔ should identify https URL - ✔ should ignore URL within path - ✔ should ignore path starting with http but without protocol - ✔ should ignore path starting with https but without protocol - warnIfCustomBuildScript - ✔ should not print warning when a default build script is found. - ✔ should print warning when a custom build script is found. - conjoinOptions - ✔ should return undefined if there's no options - ✔ should return option if there's only one - ✔ should return options without separator if there's two options - ✔ should return options with default conjunction and default separator - ✔ should return options with custom separator - ✔ should return options with custom conjunction - - fsAsync - readdirRecursive - ✔ can recurse directories - ✔ can ignore directories - ✔ supports blob rules - ✔ should support negation rules - - fsutils - fileExistsSync - ✔ should return true if the file exists - ✔ should return false if the file does not exist - ✔ should return false if the path is a directory - dirExistsSync - ✔ should return true if the directory exists - ✔ should return false if the directory does not exist - ✔ should return false if the path is a file - - functional - ✔ zipIn - ✔ assertExhaustive - flatten - ✔ can iterate an empty object - ✔ can iterate an object that's already flat - ✔ Gets the right type for flattening arrays - ✔ can handle nested objects - ✔ can handle objects with array values - ✔ can iterate an empty array - ✔ can noop arrays - ✔ can flatten - reduceFlat - ✔ can noop - ✔ can flatten - zip - ✔ can handle an empty array - ✔ can zip - ✔ throws on length mismatch - partition - ✔ should split an array into true and false - ✔ can handle an empty array - partitionRecord - ✔ should split a record into true and false - ✔ can handle an empty record - - ensureTargeted - ✔ does nothing if 'functions' is included - ✔ does nothing if the codebase is targeted - ✔ does nothing if the function is targeted - ✔ adds the codebase if missing and no id is provided - ✔ adds the function if missing - - functions/env - parse - ✔ should parse values with trailing spaces - ✔ should parse values with trailing spaces (single quotes) - ✔ should parse values with trailing spaces (double quotes) - ✔ should parse double quoted, multi-line values - ✔ should parse many double quoted values - ✔ should parse many single quoted values - ✔ should parse mix of double and single quoted values - ✔ should parse double quoted with escaped newlines - ✔ should parse escape sequences in order, from start to end - ✔ should parse double quoted with multiple escaped newlines - ✔ should parse double quoted with multiple escaped horizontal tabs - ✔ should parse double quoted with multiple escaped vertical tabs - ✔ should parse double quoted with multiple escaped carriage returns - ✔ should leave single quotes when double quoted - ✔ should leave double quotes when single quoted - ✔ should unescape escape characters for double quoted values - ✔ should leave escape characters intact for single quoted values - ✔ should leave escape characters intact for unquoted values - ✔ should parse empty value - ✔ should parse keys with leading spaces - ✔ should parse values with trailing spaces (unquoted) - ✔ should parse values with trailing spaces (single quoted) - ✔ should parse values with trailing spaces (double quoted) - ✔ should throw away unquoted values following # - ✔ should keep values following # in singqle quotes - ✔ should keep values following # in double quotes - ✔ should ignore leading/trailing spaces before the separator (unquoted) - ✔ should ignore leading/trailing spaces before the separator (single quotes) - ✔ should ignore leading/trailing spaces before the separator (double quotes) - ✔ should handle empty values - ✔ should handle quoted values after a newline - ✔ should ignore comments - ✔ should ignore empty lines - ✔ should catch invalid lines - validateKey - ✔ accepts valid keys - ✔ throws error given invalid keys - ✔ throws error given reserved keys - ✔ throws error given keys with a reserved prefix - writeUserEnvs - ✔ never affects the filesystem if the list of keys to write is empty - ✔ touches .env.projectId if it doesn't already exist - ✔ touches .env.local if it doesn't already exist in emulator mode - ✔ throws if asked to write a key that already exists in .env.projectId - ✔ is fine writing a key that already exists in .env.projectId but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in any .env - ✔ is fine writing a key that already exists in any .env but not .env.local, in emulator mode - ✔ throws if asked to write a key that already exists in .env.local, in emulator mode - ✔ throws if asked to write a key that fails key format validation - ✔ writes the specified key to a .env.projectId that it created - ✔ writes the specified key to a .env.projectId that already existed - ✔ writes multiple keys at once - ✔ escapes special characters so that parse() can reverse them - ✔ shouldn't write anything if any of the keys fails key format validation - loadUserEnvs - ✔ loads nothing if .env files are missing - ✔ loads envs from .env file - ✔ loads envs from .env file, ignoring comments - ✔ loads envs from .env. file - ✔ loads envs from .env. file - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs, preferring ones from .env. - ✔ loads envs, preferring ones from .env. for emulators too - ✔ loads envs ignoring .env.local - ✔ loads envs, preferring .env.local for the emulator - ✔ throws an error if both .env. and .env. exists - ✔ throws an error .env file is invalid - ✔ throws an error .env file contains invalid keys - ✔ throws an error .env file contains reserved keys - - functionsLog - getApiFilter - ✔ should return base api filter for v1&v2 functions - ✔ should return list api filter for v1&v2 functions - logEntries - ✔ should log no entries - ✔ should log entries - - projectConfig - normalize - ✔ normalizes singleton config - ✔ normalizes array config - ✔ throws error if given empty config - validate - ✔ passes validation for simple config - ✔ fails validation given config w/o source - ✔ fails validation given config w/ empty source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given codebase name with capital letters - ✔ fails validation given codebase name with invalid characters - ✔ fails validation given long codebase name - normalizeAndValidate - ✔ returns normalized config for singleton config - ✔ returns normalized config for multi-resource config - ✔ fails validation given singleton config w/o source - ✔ fails validation given singleton config w empty source - ✔ fails validation given multi-resource config w/o source - ✔ fails validation given config w/ duplicate source - ✔ fails validation given config w/ duplicate codebase - - functions-config-export - getAllProjects - ✔ should include projectId from the options - ✔ should include project and its alias from firebaserc - convertKey - ✔ should converts valid config key - ✔ should throw error if conversion is invalid - ✔ should use prefix to fix invalid config keys - ✔ should throw error if prefix is invalid - configToEnv - ✔ should convert valid functions config - ✔ should collect errors for invalid conversions - ✔ should use prefix to fix invalid keys - toDotenvFormat - ✔ should produce valid dotenv file with keys - ✔ should preserve newline characters - generateDotenvFilename - ✔ should generate dotenv filename using project alias - ✔ should generate dotenv filename using project id if alias doesn't exist - - functions/secret - ensureValidKey - ✔ returns the original key if it follows convention - ✔ returns the transformed key (with warning) if with dashes - ✔ returns the transformed key (with warning) if with periods - ✔ returns the transformed key (with warning) if with lower cases - ✔ returns the transformed key (with warning) if camelCased - ✔ throws error if given non-conventional key w/ forced option - ✔ throws error if given reserved key - ensureSecret - ✔ returns existing secret if we have one - ✔ prompt user to have Firebase manage the secret if not managed by Firebase - ✔ does not prompt user to have Firebase manage the secret if already managed by Firebase - ✔ creates a new secret if it doesn't exists - ✔ throws if it cannot reach Secret Manager - of - ✔ returns empty list given empty list - ✔ collects all secret environment variables - getSecretVersions - ✔ returns object mapping secrets and their versions - pruneSecrets - ✔ returns nothing if unused - ✔ returns all secrets given no endpoints - ✔ does not include secret version in use - ✔ resolves 'latest' secrets and properly prunes it - inUse - ✔ returns true if secret is in use - ✔ returns true if secret is in use by project number - ✔ returns false if secret is not in use - ✔ returns false if secret of same name from another project is in use - pruneAndDestroySecrets - ✔ destroys pruned secrets - ✔ collects errors - updateEndpointsSecret - ✔ returns early if secret is not in use - ✔ updates function with the version of the given secret - - config.parseSetArgs - ✔ should throw if a reserved namespace is used - ✔ should throw if a malformed arg is used - ✔ should parse args into correct config and variable IDs - - config.parseUnsetArgs - ✔ should throw if a reserved namespace is used - ✔ should parse args into correct config and variable IDs - - cloudfunctions - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ detects task queue functions - ✔ detects beforeCreate blocking functions - ✔ detects beforeSignIn blocking functions - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should translate event triggers - ✔ should translate scheduled triggers - ✔ should translate task queue triggers - ✔ should translate beforeCreate blocking triggers - ✔ should translate beforeSignIn blocking triggers - ✔ should copy optional fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - listFunctions - ✔ should pass back an error with the correct status - - cloudfunctionsv2 - megabytes - ✔ Should handle decimal SI units - ✔ Should handle binary SI units - ✔ Should handle no unit - functionFromEndpoint - ✔ should guard against version mixing - ✔ should copy a minimal function - ✔ should copy trival fields - ✔ should calculate non-trivial fields - ✔ should correctly convert CPU and concurrency values - ✔ should export codebase as label - ✔ should export hash as label - endpointFromFunction - ✔ should copy a minimal version - ✔ should copy run service IDs - ✔ should translate event triggers - ✔ should translate custom event triggers - ✔ should translate task queue functions - ✔ should translate beforeCreate blocking functions - ✔ should translate beforeSignIn blocking functions - ✔ should copy optional fields - ✔ should transform fields - ✔ should derive codebase from labels - ✔ should derive hash from labels - ✔ should convert function without serviceConfig - listFunctions - ✔ should pass back an error with the correct status - - queryTimeSeries - ✔ should make a POST call to the correct endpoint - ✔ should throw a FirebaseError if the endpoint returns an error response - - cloudscheduler - createOrUpdateJob - ✔ should create a job if none exists - ✔ should do nothing if a functionally identical job exists - ✔ should do nothing if a job exists with superset retry config. - ✔ should update if a job exists with the same name and a different schedule - ✔ should update if a job exists with the same name but a different timeZone - ✔ should update if a job exists with the same name but a different retry config - ✔ should error and exit if cloud resource location is not set - ✔ should error and exit if cloud scheduler create request fail - jobFromEndpoint - ✔ should copy minimal fields for v1 endpoints - ✔ should copy minimal fields for v2 endpoints - ✔ should copy optional fields for v1 endpoints - ✔ should copy optional fields for v2 endpoints - - CloudTasks - queueFromEndpoint - ✔ handles minimal endpoints - ✔ handles complex endpoints - triggerFromQueue - ✔ handles queue with default settings - ✔ handles queue with custom configs - upsertEndpoint - ✔ accepts a matching queue - ✔ updates a non-matching queue - ✔ purges a disabled queue - setEnqueuer - ✔ can blind-write - ✔ preserves other roles - ✔ noops existing matches - ✔ can insert an enqueuer binding - ✔ can resolve conflicts - - iam - testIamPermissions - ✔ should pass if we have all permissions - ✔ should fail if we don't have all permissions - - proto - ✔ pruneUndefindes - duration - ✔ should convert from seconds to duration - ✔ should convert from duration to seconds - copyIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support variadic params - renameIfPresent - ✔ should copy present fields - ✔ should not copy missing fields - ✔ should support transformations - ✔ should support transformations with renames - fieldMasks - ✔ should copy simple fields - ✔ should handle empty values - ✔ should nest into objects - ✔ should include empty objects - ✔ should support map types - getInvokerMembers - ✔ should return empty array with private invoker - ✔ should return allUsers with public invoker - ✔ should return formatted service accounts with invoker array - formatServiceAccount - ✔ should throw error on empty service account string - ✔ should throw error on badly formed service account string - ✔ should return formatted service account from invoker ending with @ - ✔ should return formatted service account from invoker with full service account - - run - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the setting the IAM policy fails - ✔ should set a private policy on a function - ✔ should set a public policy on a function - ✔ should set the policy with a set of invokers with active policies - setInvokerUpdate - setInvokerCreate - ✔ should reject on emtpy invoker array - ✔ should reject if the getting the IAM policy fails - ✔ should reject if the setting the IAM policy fails - ✔ should set a basic policy on a function without any polices - ✔ should set the policy with private invoker with active policies - ✔ should set the policy with a set of invokers with active policies - ✔ should not set the policy if the set of invokers is the same as the current invokers - updateService - ✔ handles noops immediately - ✔ loops on ready status - serviceIsResolved - ✔ returns false if the observed generation isn't the metageneration - ✔ returns false if the status is not ready - ✔ throws if we have an failed status - ✔ returns true if resolved - - secretManager - parseSecretResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ parse secret version resource name - parseSecretVersionResourceName - ✔ parses valid secret resource name - ✔ throws given invalid resource name - ✔ throws given incomplete resource name - ✔ throws given secret resource name - ensureServiceAgentRole - ✔ adds new binding for each member - ✔ adds bindings only for missing members - ✔ keeps bindings that already exists - ✔ does nothing if the binding already exists - - hosting - getChannel - ✔ should make the API request for a channel - ✔ should return null if there's no channel - ✔ should throw an error if the server returns an error - listChannels - ✔ should make a single API requests to list a small number of channels - ✔ should make multiple API requests to list channels - ✔ should return an error if there's no channel - ✔ should throw an error if the server returns an error - createChannel - ✔ should make the API request to create a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - updateChannelTtl - ✔ should make the API request to update a channel - ✔ should let us customize the TTL - ✔ should throw an error if the server returns an error - deleteChannel - ✔ should make the API request to delete a channel - ✔ should throw an error if the server returns an error - createVersion - ✔ should make the API requests to create a version - ✔ should throw an error if the server returns an error - updateVersion - ✔ should make the API requests to update a version - ✔ should throw an error if the server returns an error - listVersions - ✔ returns a single page of versions - ✔ paginates through many versions - ✔ handles errors - cloneVersion - ✔ should make the API requests to clone a version - ✔ should throw an error if the server returns an error - createRelease - ✔ should make the API request to create a release - ✔ should include a message, if provided - ✔ should throw an error if the server returns an error - getSite - ✔ should make the API request for a channel - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - listSites - ✔ should make a single API requests to list a small number of sites - ✔ should make multiple API requests to list sites - ✔ should return an error if there's no site - ✔ should throw an error if the server returns an error - createSite - ✔ should make the API request to create a channel - ✔ should throw an error if the server returns an error - updateSite - ✔ should make the API request to update a site - ✔ should throw an error if the server returns an error - deleteSite - ✔ should make the API request to delete a site - ✔ should throw an error if the server returns an error - getCleanDomains - ✔ should return the list of expected auth domains after syncing - getSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - ✔ should throw an error if the server returns an error - getAllSiteDomains - ✔ should get the site domains - ✔ should throw an error if the site doesn't exist - - normalizeName - ✔ should handle the normalization of happy-path - ✔ should handle the normalization of feature/branch - ✔ should handle the normalization of featuRe/Branch - ✔ should handle the normalization of what/are:you_thinking - ✔ should handle the normalization of happyBranch - ✔ should handle the normalization of happy:branch - ✔ should handle the normalization of happy_branch - ✔ should handle the normalization of happy#branch - - cloudRunProxy - ✔ should error when not provided a valid Cloud Run service ID - ✔ should error when the Cloud Run service doesn't exist - ✔ should error when the Cloud Run service doesn't exist - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should pass on provided headers to the origin - ✔ should not send the `host` header if it's provided - ✔ should resolve to a live version in another region - ✔ should cache calls to look up Cloud Run service URLs - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a timeout error occurs calling the Cloud Run service - ✔ should respond with a 504 error if a sockettimeout error occurs calling the Cloud Run service - - config - ✔ normalize - extract - ✔ should handle no hosting config - ✔ should fail if both site and target are specified - ✔ should always return an array - ✔ should support legacy method of specifying site - resolveTargets - ✔ should not modify the config - ✔ should add sites when found - ✔ should prohibit multiple sites - filterOnly - ✔ should be able to parse a normal hosting config, specifying the default site - ✔ should be able to parse a hosting config with multiple sites, no targets, specifying the second site - ✔ should be able to parse a normal hosting config with a target - ✔ should be able to parse a hosting config with multiple targets, specifying one - ✔ should be able to parse a hosting config with multiple targets, specifying all hosting - ✔ should be able to parse a hosting config with multiple targets, specifying an invalid target - ✔ should be able to parse a hosting config with multiple sites but no targets, only an invalid target - ✔ should be able to parse a hosting config without an only string - ✔ should be able to parse a hosting config with a non-hosting only flag - with an except parameter, resolving targets - ✔ should be able to parse a hosting config with multiple sites, no targets, omitting the second site - ✔ should be able to parse a normal hosting config with a target, omitting the target - ✔ should be able to parse a hosting config with multiple targets, omitting one - ✔ should be able to parse a hosting config with multiple targets, omitting all hosting - ✔ should be able to parse a hosting config with multiple targets, omitting an invalid target - ✔ should be able to parse a hosting config with no excpet string - ✔ should be able to parse a hosting config with a non-hosting except string - validate - ✔ should error out if there is no public directory but a 'destination' rewrite - ✔ should error out if there is no public directory and an i18n with root - ✔ should error out if there is a public direcotry and an i18n with no root - ✔ should error out if region is set and function is unset - ✔ should error out if region is set and functions is the new form - ✔ should pass with public and nothing else - ✔ should pass with no public but a function rewrite - ✔ should pass with no public but a run rewrite - ✔ should pass with no public but a redirect - - calculateChannelExpireTTL - ✔ should be able to parse time 30d - ✔ should be able to parse time 1d - ✔ should be able to parse time 2d - ✔ should be able to parse time 2h - ✔ should be able to parse time 56m - ✔ should be able to parse time 1.5d - ✔ should be able to parse time 2x - ✔ should be able to parse time 2dd - ✔ should be able to parse time 0.5m - ✔ should be able to parse time undefined - ✔ should throw if greater than 30d - - functionsProxy - ✔ should resolve a function returns middleware that proxies to the live version - ✔ should resolve a function returns middleware that proxies to the live version in another region - ✔ should resolve a function that returns middleware that proxies to a local version - ✔ should resolve a function that returns middleware that proxies to a local version in another region - ✔ should maintain the location header as returned by the function - ✔ should allow location headers that wouldn't redirect to itself - ✔ should proxy a request body on a POST request - ✔ should proxy with a query string - ✔ should return 3xx responses directly - ✔ should pass through multiple set-cookie headers - ✔ should pass through normal 404 errors - ✔ should do nothing on 404 errors with x-cascade - ✔ should remove cookies on non-private cached responses - ✔ should add required Vary headers to the response - ✔ should respond with a 500 error if an error occurs calling the function - ✔ should respond with a 504 error if a timeout error occurs calling the function - ✔ should respond with a 504 error if a sockettimeout error occurs calling the function - - initMiddleware - ✔ should be able to proxy a basic sdk request - ✔ should be able to proxy with the correct accept-encoding - ✔ should provide the init.js file - ✔ should provide the emulator init.js file when appropriate - ✔ should provide the firebase config (init.json) - ✔ should pass (call next) if the sdk file doesn't exit - ✔ should ignore any other request path (200) - ✔ should ignore any other request path (403) - when dealing with compressed data - ✔ should return compressed data if it is returned compressed - - runTags - gcTagsForServices - ✔ leaves only active revisions - setRewriteTags - ✔ preserves existing tags and other types of rewrites - ✔ replaces tags in rewrites with new/verified tags - ✔ garbage collects if necessary - ensureLatestRevisionTagged - ✔ Reuses existing tag names - ✔ Adds new tags as necessary - - firestore - doSetup - ✔ should require access, set up rules and indices, ensure cloud resource location set - ✔ should error when the firestore API is not enabled - ✔ should error when firestore is in the wrong mode - - functions - doSetup - with an uninitialized Firebase project repository - ✔ creates a new javascript codebase with the correct configuration (118ms) - ✔ creates a new typescript codebase with the correct configuration (113ms) - with an existing functions codebase in Firebase repository - ✔ initializes a new codebase - ✔ reinitializes an existing codebase - - project - doSetup - with "Use an existing project" option - ✔ should set up the correct properties in the project - with "Create a new project" option - ✔ should create a new project and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Add Firebase resources to GCP project" option - ✔ should add firebase resources and set up the correct properties - ✔ should throw if project ID is empty after prompt - with "Don't set up a default project" option - ✔ should set up the correct properties when not choosing a project - with defined .firebaserc file - ✔ should not prompt - ✔ should set project location even if .firebaserc is already set up - - storage - doSetup - ✔ should set up the correct properties in the project - ✔ should error when cloud resource location is not set - - listFiles - ✔ should ignore firebase-debug.log, specified ignores, and nothing else - ✔ should allow us to not specify additional ignores - - localFunction._constructAuth - #_constructAuth - ✔ warn if opts.auth and opts.authType are conflicting - ✔ construct the correct auth for admin users - ✔ construct the correct auth for unauthenticated users - ✔ construct the correct auth for authenticated users - ✔ leaves auth untouched if it already follows wire format - localFunction._makeFirestoreValue - ✔ returns {} when there is no data - ✔ throws error when data is not key-value pairs - - App management - getAppPlatform - ✔ should return the iOS platform - ✔ should return the Android platform - ✔ should return the Web platform - ✔ should return the ANY platform - ✔ should throw if the platform is unknown - createIosApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createAndroidApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - createWebApp - ✔ should resolve with app data if it succeeds - ✔ should reject if app creation api call fails - ✔ should reject if polling throws error - listFirebaseApps - ✔ should resolve with app list if it succeeds with only 1 api call - ✔ should resolve with iOS app list - ✔ should resolve with Android app list - ✔ should resolve with Web app list - ✔ should concatenate pages to get app list if it succeeds - ✔ should reject if the first api call fails - ✔ should rejects if error is thrown in subsequence api call - ✔ should reject if the list iOS apps fails - ✔ should reject if the list Android apps fails - ✔ should reject if the list Web apps fails - getAppConfigFile - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - getAppConfig - ✔ should resolve with iOS app configuration if it succeeds - ✔ should resolve with Android app configuration if it succeeds - ✔ should resolve with Web app configuration if it succeeds - ✔ should reject if api request fails - - Database management - getDatabaseInstanceDetails - ✔ should resolve with DatabaseInstance if API call succeeds - ✔ should reject if API call fails - createInstance - ✔ should resolve with new DatabaseInstance if API call succeeds - ✔ should reject if API call fails - checkInstanceNameAvailable - ✔ should resolve with new DatabaseInstance if specified instance name is available and API call succeeds - ✔ should resolve with suggested instance names if the API call fails with suggestions - ✔ should reject if API call fails without suggestions - listDatabaseInstances - ✔ should resolve with instance list if it succeeds with only 1 api call - ✔ should resolve with specific location - ✔ should concatenate pages to get instances list if it succeeds - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - - Project management - Interactive flows - getOrPromptProject - ✔ should get project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - ✔ should get the correct project info when --project is supplied - ✔ should throw error when getFirebaseProject throw an error - promptAvailableProjectId - ✔ should select project from list if it is able to list all projects - ✔ should prompt project id if it is not able to list all projects - ✔ should throw if there's no project - API methods - createCloudProject - ✔ should resolve with cloud project data if it succeeds - ✔ should reject if Cloud project creation fails - ✔ should reject if Cloud project creation polling throws error - addFirebaseToCloudProject - ✔ should resolve with Firebase project data if it succeeds - ✔ should reject if add Firebase api call fails - ✔ should reject if polling add Firebase operation throws error - getAvailableCloudProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - getFirebaseProjectPage - ✔ should resolve with a project page if it succeeds (no input token) - ✔ should resolve with a project page if it succeeds (with input token) - ✔ should resolve with a project page if it succeeds with no next page token - ✔ should reject if the api call fails - listFirebaseProjects - ✔ should resolve with project list if it succeeds with only 1 api call - ✔ should concatenate pages to get project list if it succeeds with multiple api calls - ✔ should reject if the first api call fails - ✔ should reject if error is thrown in subsequent api call - getFirebaseProject - ✔ should resolve with project information if it succeeds - ✔ should reject if the api call fails - - metaprogramming - ✔ can calcluate recursive keys - ✔ can detect recursive elems - ✔ Can deep pick - ✔ can deep omit - - OperationPoller - poll - ✔ should return result with response field if polling succeeds - ✔ should return result with error field if polling operation returns failure response - ✔ should return result with error field if api call rejects with unrecoverable error - ✔ should retry polling if http request responds with 500 or 503 status code (70ms) - ✔ should retry polling until the LRO is done (74ms) - ✔ should reject with TimeoutError when timed out after failed retries (202ms) -[ - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444', - 'GET https://firebasedummy.googleapis.com.com:443/v1/operations/cp.3322442424242444' -] - ✔ should call onPoll each time the operation is polled - - profilerReport - ✔ should correctly generate a report - ✔ should format numbers correctly - ✔ should not collapse paths if not needed - ✔ should collapse paths to $wildcard - ✔ should not collapse paths with --no-collapse - ✔ should collapse paths recursively - ✔ should extract the correct path index - ✔ should extract the correct value index - - getProjectId - ✔ should prefer projectId, falling back to project - - needProjectId - ✔ should throw when no project provided and no aliases available - ✔ should throw and mention aliases when they are available - ✔ should return projectId, falling back to project - - needProjectNumber - ✔ should return the project number from options, if present - ✔ should fetch the project number if necessary - ✔ should reject with an error on an error - - getAliases - ✔ should return the aliases for a projectId - ✔ should return an empty array if there are no aliases in rc - - prompt - prompt - ✔ should error if questions are asked in nonInteractive environment - ✔ should utilize inquirer to prompt for the questions - ✔ should add the new values to the options object - promptOnce - ✔ should provide a name if one is not provided - ✔ should return the value for the given name - ✔ should handle names with .'s - - RC - .load - ✔ should load from nearest project directory - ✔ should be an empty object when not in project dir - ✔ should not throw up on invalid json - ✔ should load from the right directory when --config is specified - instance methods - #addProjectAlias - ✔ should set a value in projects. - #removeProjectAlias - ✔ should remove an already set value in projects. - #hasProjects - ✔ should be true if project aliases are set, false if not - #allTargets - ✔ should return all targets of all types for a project - #targets - ✔ should return all targets for specified project and type - ✔ should return an empty object for missing data - #target - ✔ should return all resources for a specified target - ✔ should return an empty array if nothing is found - #unsetTargetResource - ✔ should remove a resource from a target - ✔ should no-op if the resource is not in the target - #applyTarget - ✔ should error for an unrecognized target type - ✔ should coerce a string argument into an array - ✔ should add all resources to the specified target - ✔ should remove a resource from a different target - ✔ should return a list of resources that changed targets - #removeTarget - ✔ should remove a the target for a specific resource and return its name - ✔ should return null if not present - #clearTarget - ✔ should clear an existing target by name and return true - ✔ should return false for a non-existent target - - Remote Config GET - getTemplate - ✔ should return the latest template - ✔ should return the correct version of the template if version is specified - ✔ should return a correctly parsed entry value with one parameter - ✔ should return a correctly parsed entry value with two parameters - ✔ should reject if the api call fails - - RemoteConfig Rollback - rollbackCurrentVersion - ✔ should return a rollback to the version number specified - - should reject invalid rollback version number - - should return a rollback to the previous version - ✔ should reject if the api call fails - - RemoteConfig ListVersions - getVersionTemplate - ✔ should return the list of versions up to the limit - ✔ should return all the versions when the limit is 0 - ✔ should return with default 10 versions when no limit is set - ✔ should reject if the api call fails - - requireConfig - ✔ should resolve if config exists - ✔ should fail if config does not exist - ✔ should return the existing configError if one is set - - RulesDeploy - addFile - ✔ should successfully add a file that exists - ✔ should throw an error if the file does not exist - compile - ✔ should succeed if there are no files to compile - ✔ should succeed if there is one file to compile - ✔ should succeed if there are multiple files to compile - ✔ should fail if one file fails to compile (method error) - ✔ should fail if one file fails to compile (returned an error in the response) - ✔ should fail if one file fails to compile (returned multiple errors in the response) - ✔ should succeed if the compile returns a warning (returned a warning in the response) - createRulesets - with no initial rules - ✔ should not create rulesets if none were provided - ✔ should create rulesets if one was provided - ✔ should throw an error if createRuleset fails - ✔ should create multiple rulesets if multiple are provided - with initial rules - ✔ should throw an error if createRuleset fails - ✔ should not create rulesets if none were provided - ✔ should not create any additional rules if they all match - ✔ should create any rules for a single one that does not match - ✔ should create all rules if none match - with cross-service rules - ✔ should deploy even with IAM failure - ✔ should update permissions if prompted - ✔ should not update permissions if declined - ✔ should not prompt if role already granted - when there are quota issues - ✔ should throw if it return not a quota issue - ✔ should do nothing if there are not a lot of previous rulesets - and a prompt is made - ✔ should prompt for a choice (no) - ✔ should prompt for a choice (yes) and delete and retry creation - release - ✔ should release the rules - ✔ should enforce a subresource for storage - ✔ should append a subresource for storage - - shortenUrl - ✔ should return a shortened url with an unguessable suffix by default - ✔ should request a short suffix URL if guessable is true - ✔ should return the original URL in case of an error - - Throttler - Queue - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (65ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - Stack - ✔ should have no waiting task after creation - ✔ should return the task as the task name - ✔ should return the index as the task name - ✔ should return 'finished task' as the task name - ✔ should handle function tasks - ✔ should handle tasks - ✔ should not retry - ✔ should retry the number of retries, plus one - ✔ should handle tasks in concurrency - ✔ should retry the number of retries for mutiple identical tasks - ✔ should return the result of task - ✔ should resolve if task finishes before timeout - ✔ should reject if timeout (101ms) - ✔ should reject with RetriesExhaustedError if last trial is rejected before timeout (64ms) - ✔ should reject with TimeoutError if timeout while retrying (103ms) - ✔ should reject with TimeoutError when waiting - ✔ should reject with RetriesExhaustedError when waiting - - timeToWait - ✔ should wait the base delay on the first attempt - ✔ should back off exponentially - ✔ should not wait longer than maxDelay - - Queue - ✔ should have default name of queue - ✔ should be first-in-first-out - - Stack - ✔ should have default name of stack - ✔ should be first-in-last-out - ✔ should not repeat completed tasks - - unzip - ✔ should unzip a zip file with compressed-cp866 case - ✔ should unzip a zip file with compressed-directory-entry case - ✔ should unzip a zip file with compressed-flags-set case - ✔ should unzip a zip file with compressed-standard case - ✔ should unzip a zip file with uncompressed case - ✔ should unzip a zip file with zip-slip case - ✔ should unzip a zip file with zip64 case - - utils - consoleUrl - ✔ should create a console URL - getInheritedOption - ✔ should chain up looking for a key - ✔ should return undefined if the key does not exist - envOverride - ✔ should return the value if no current value exists - ✔ should set an override if it conflicts - ✔ should coerce the value - ✔ should return provided value if coerce fails - isCloudEnvironment - ✔ should return false by default - ✔ should return true when in codespaces - ✔ should return true when in Cloud Workstations - getDatabaseUrl - ✔ should create a url for prod - ✔ should create a url for the emulator - getDatabaseViewDataUrl - ✔ should get a view data url for legacy prod URL - ✔ should get a view data url for new prod URL - ✔ should get a view data url for the emulator - addDatabaseNamespace - ✔ should add the namespace for prod - ✔ should add the namespace for the emulator - addSubdomain - ✔ should add a subdomain - endpoint - ✔ should join our strings - promiseAllSettled - ✔ should settle all promises - promiseProps - ✔ should resolve all promises - ✔ should pass through objects - ✔ should reject if a promise rejects - datetimeString - ✔ should output the date in the correct format - streamToString/stringToStream - ✔ should be able to create and read streams - allSettled - ✔ handles arrays of length zero - ✔ handles a simple success - ✔ handles a simple failure - ✔ waits for all settled - groupBy - ✔ should transform simple array by fn - ✔ should transform array of objects by fn - withTimeout - ✔ should fulfill if the original promise fulfills within timeout - ✔ should reject if the original promise rejects within timeout - ✔ should reject with timeout if the original promise takes too long to fulfill - ✔ should reject with timeout if the original promise takes too long to reject - debounce - ✔ should be called only once in the given time interval - ✔ should be called only once if it is called many times within the interval - ✔ should be called only once within the interval if leading is provided - ✔ should be called twice with leading - connnectableHostname - ✔ should change wildcard IP addresses to corresponding loopbacks - ✔ should not change non-wildcard IP addresses or hostnames - - - 2542 passing (22s) - 4 pending - 1 failing - - 1) apiv2 - request - should error with a FirebaseError if JSON is malformed: - AssertionError: expected promise to be rejected with an error matching /Unexpected token.+JSON/ but got 'Unable to parse JSON: SyntaxError: Expected property name or \'}\' in JSON at position 1' - - - - ----------------------------------------|---------|----------|---------|---------|------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------------|---------|----------|---------|---------|------------------- -All files | 55.82 | 43.53 | 51.61 | 55.93 | - src | 65.43 | 50.74 | 65.36 | 65.44 | - accountExporter.ts | 73.45 | 56.41 | 90 | 73.21 | ...60-161,210-220 - accountImporter.ts | 61.81 | 37.7 | 100 | 61.27 | ...81-241,271,296 - api.ts | 98.51 | 33.33 | 100 | 98.51 | 79 - apiv2.ts | 94.51 | 89.58 | 95.65 | 94.51 | ...69,284,334,514 - archiveDirectory.ts | 55.93 | 40 | 40 | 55.93 | ...,90,93,127-172 - auth.ts | 25.58 | 11.26 | 18.75 | 25.6 | ...06-710,714-723 - checkMinRequiredVersion.ts | 100 | 100 | 100 | 100 | - checkValidTargetFilters.ts | 100 | 100 | 100 | 100 | - command.ts | 72.99 | 55.56 | 75 | 72.99 | ...34,336-337,374 - config.ts | 62.5 | 52 | 62.5 | 62.5 | ...83-236,264,271 - configstore.ts | 100 | 100 | 100 | 100 | - defaultCredentials.ts | 80 | 58.33 | 100 | 80 | ...39,53,57,79,88 - deploymentTool.ts | 88.89 | 80 | 100 | 88.89 | 8 - detectProjectRoot.ts | 93.75 | 87.5 | 100 | 93.75 | 10 - downloadUtils.ts | 100 | 100 | 100 | 100 | - dynamicImport.js | 15.38 | 0 | 0 | 25 | 4-10 - ensureApiEnabled.ts | 93.33 | 87.5 | 85.71 | 93.33 | 98,111,155 - ensureCloudResourceLocation.ts | 100 | 100 | 100 | 100 | - error.ts | 100 | 91.3 | 100 | 100 | 55 - errorOut.ts | 30 | 0 | 0 | 30 | 10-22 - experiments.ts | 66.67 | 55.56 | 63.64 | 68.18 | ...56,189-207,216 - fetchWebSetup.ts | 77.27 | 60 | 83.33 | 79.07 | 71-77,110-112,125 - filterTargets.ts | 55 | 33.33 | 100 | 55 | 23,26-39 - firebaseConfigValidate.ts | 82.35 | 50 | 100 | 82.35 | 36-41 - fsAsync.ts | 100 | 100 | 100 | 100 | - fsutils.ts | 93.75 | 50 | 100 | 93.75 | 27 - functional.ts | 95.83 | 88.89 | 93.75 | 95.74 | 91,145 - functionsConfig.ts | 51.61 | 21.88 | 26.32 | 51.61 | ...31,135-149,167 - functionsConfigClone.ts | 15 | 0 | 0 | 15.38 | 10-57,67-79 - functionsShellCommandAction.ts | 23.68 | 0 | 0 | 22.67 | 23-147 - getDefaultDatabaseInstance.ts | 50 | 0 | 0 | 50 | 9-10 - getDefaultHostingSite.ts | 36.36 | 0 | 0 | 36.36 | 11-20 - getProjectNumber.ts | 33.33 | 0 | 0 | 33.33 | 9-15 - index.ts | 52.38 | 0 | 20 | 53.66 | ...6,50-56,79-100 - listFiles.ts | 100 | 100 | 100 | 100 | - loadCJSON.ts | 62.5 | 0 | 100 | 62.5 | 11-14 - localFunction.js | 40 | 34.38 | 30 | 40 | ...35-154,158-218 - logError.ts | 17.65 | 0 | 0 | 17.65 | 6-25 - logger.ts | 90 | 60 | 100 | 90 | 57-58 - operation-poller.ts | 100 | 100 | 100 | 100 | - parseBoltRules.ts | 40 | 0 | 0 | 40 | 9-29 - profileReport.ts | 72.52 | 59.66 | 76.19 | 72.52 | ...67,571-621,657 - profiler.ts | 21.31 | 0 | 0 | 21.31 | 22-121 - projectPath.ts | 87.5 | 50 | 100 | 87.5 | 17 - projectUtils.ts | 100 | 90 | 100 | 100 | 43 - prompt.ts | 88.46 | 70.37 | 100 | 88 | 111-112,118 - rc.ts | 86.21 | 82.69 | 83.33 | 86.05 | ...26-230,238-241 - requireAuth.ts | 56.1 | 16.67 | 33.33 | 56.1 | 24-40,61-73,87-91 - requireConfig.ts | 100 | 100 | 100 | 100 | - requireDatabaseInstance.ts | 38.46 | 0 | 0 | 38.46 | 18-32 - requireHostingSite.ts | 33.33 | 0 | 0 | 33.33 | 8-13 - requireInteractive.ts | 40 | 0 | 0 | 40 | 6-13 - requirePermissions.ts | 40 | 0 | 0 | 40 | 19-42 - responseToError.ts | 90.91 | 87.5 | 100 | 90.91 | 7,12 - rtdb.ts | 30 | 0 | 0 | 30 | 16-45 - rulesDeploy.ts | 98.18 | 91.67 | 100 | 98.15 | 114,119 - scopes.ts | 100 | 100 | 100 | 100 | - shortenUrl.ts | 100 | 100 | 100 | 100 | - track.ts | 38.36 | 28.81 | 50 | 38.36 | ...43-271,277-290 - unzip.ts | 62.79 | 36 | 30 | 61.9 | ...12,126-157,163 - utils.ts | 73.4 | 51.47 | 75 | 72.79 | ...88,694,742-744 - src/appdistribution | 73.28 | 61.67 | 52.17 | 73.28 | - client.ts | 94.92 | 86.11 | 80 | 94.92 | 77-78,98 - distribution.ts | 77.78 | 54.55 | 80 | 77.78 | 21,30,37-38,41,50 - options-parser-util.ts | 26.67 | 0 | 0 | 26.67 | ...49,53-54,59-63 - src/commands | 36.91 | 0.9 | 2.27 | 37.13 | - appdistribution-distribute.ts | 15 | 0 | 0 | 15 | 21-28,48-170 - appdistribution-testers-add.ts | 54.55 | 100 | 0 | 54.55 | 12-16 - appdistribution-testers-remove.ts | 40 | 0 | 0 | 40 | 14-30 - apps-android-sha-create.ts | 38.89 | 0 | 0 | 43.75 | 10-14,22-35 - apps-android-sha-delete.ts | 70 | 0 | 0 | 70 | 13-16 - apps-android-sha-list.ts | 27.59 | 0 | 0 | 27.59 | 11-36,43-52 - apps-create.ts | 13.92 | 0 | 0 | 13.92 | 52-158,176-213 - apps-list.ts | 30.3 | 0 | 0 | 30.3 | 14-32,42-60 - apps-sdkconfig.ts | 18.97 | 0 | 0 | 18.97 | 23-47,64-136 - auth-export.ts | 37.04 | 0 | 0 | 37.04 | 27-52 - auth-import.ts | 19.72 | 0 | 0 | 19.72 | 49-138 - ...hlytics-mappingfile-generateid.ts | 31.25 | 0 | 0 | 31.25 | 25-43 - crashlytics-mappingfile-upload.ts | 21.74 | 0 | 0 | 21.74 | 28-63 - crashlytics-symbols-upload.ts | 27.91 | 28.57 | 20 | 27.91 | 39-113 - database-get.ts | 23.44 | 0 | 0 | 23.81 | 31-45,74-146 - database-import.ts | 37.25 | 0 | 0 | 37.25 | 57-115 - database-instances-create.ts | 57.89 | 0 | 0 | 57.89 | 27-40 - database-instances-list.ts | 30 | 9.09 | 0 | 30 | 22-40,48-80,84 - database-profile.ts | 52.63 | 0 | 0 | 52.63 | 36-52 - database-push.ts | 40.54 | 0 | 0 | 40.54 | 30-74 - database-remove.ts | 54.55 | 0 | 0 | 54.55 | 26-46 - database-set.ts | 43.24 | 0 | 0 | 43.24 | 32-77 - database-settings-get.ts | 56.52 | 0 | 0 | 56.52 | 29-55 - database-settings-set.ts | 50 | 0 | 0 | 50 | 28-54 - database-update.ts | 44.44 | 0 | 0 | 44.44 | 32-77 - deploy.ts | 52.17 | 0 | 0 | 52.17 | 63-86 - emulators-exec.ts | 80 | 100 | 0 | 80 | 18 - emulators-export.ts | 83.33 | 100 | 0 | 83.33 | 12 - emulators-start.ts | 17.74 | 0 | 0 | 17.74 | 16,29-125 - experimental-functions-shell.ts | 100 | 100 | 100 | 100 | - experiments-describe.ts | 33.33 | 0 | 0 | 33.33 | 12-31 - experiments-disable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-enable.ts | 36.84 | 0 | 0 | 36.84 | 12-28 - experiments-list.ts | 37.5 | 0 | 0 | 37.5 | 8-24 - ext-configure.ts | 37.04 | 0 | 0 | 37.04 | 46-152 - ext-dev-deprecate.ts | 30.77 | 0 | 0 | 30.77 | 33-96 - ext-dev-init.ts | 18.52 | 0 | 0 | 18.52 | 21,44-230 - ext-dev-list.ts | 43.48 | 0 | 0 | 45.45 | 20-56 - ext-dev-publish.ts | 69.23 | 0 | 0 | 69.23 | 35-42 - ext-dev-register.ts | 50 | 0 | 0 | 50 | 29-71 - ext-dev-undeprecate.ts | 36.36 | 0 | 0 | 36.36 | 22-68 - ext-dev-upload.ts | 45 | 0 | 0 | 45 | 64-130 - ext-dev-usage.ts | 28.85 | 0 | 0 | 28.85 | 26-174 - ext-export.ts | 37.5 | 0 | 0 | 38.46 | 30-94 - ext-info.ts | 17.57 | 0 | 0 | 17.57 | 25-121 - ext-install.ts | 29.49 | 0 | 0 | 29.49 | 55-241 - ext-list.ts | 77.78 | 100 | 0 | 77.78 | 14-15 - ext-uninstall.ts | 71.43 | 0 | 0 | 71.43 | 29-36 - ext-update.ts | 41.18 | 0 | 0 | 41.18 | 50-155 - ext.ts | 43.48 | 100 | 0 | 43.48 | 20-44 - firestore-databases-create.ts | 37.5 | 0 | 0 | 37.5 | 24-67 - firestore-databases-delete.ts | 47.62 | 0 | 0 | 47.62 | 21-43 - firestore-databases-get.ts | 50 | 0 | 0 | 50 | 15-26 - firestore-databases-list.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - firestore-databases-update.ts | 39.13 | 0 | 0 | 39.13 | 23-60 - firestore-delete.ts | 31.03 | 0 | 0 | 31.03 | 14-60,96-128 - firestore-indexes-list.ts | 36.36 | 0 | 0 | 36.36 | 24-45 - firestore-locations.ts | 53.85 | 0 | 0 | 53.85 | 15-25 - functions-config-clone.ts | 40 | 0 | 0 | 40 | 31-54 - functions-config-export.ts | 24.66 | 0 | 0 | 26.09 | 31-93,107-153 - functions-config-get.ts | 42.11 | 0 | 0 | 42.11 | 11-19,32-34 - functions-config-set.ts | 42.86 | 0 | 0 | 42.86 | 27-47 - functions-config-unset.ts | 50 | 0 | 0 | 50 | 28-42 - functions-delete.ts | 40 | 0 | 0 | 40.91 | 32-114 - functions-list.ts | 38.1 | 0 | 0 | 38.1 | 15-41 - functions-log.ts | 45 | 0 | 0 | 45 | 21-40 - functions-secrets-access.ts | 50 | 0 | 0 | 50 | 14-20 - functions-secrets-destroy.ts | 20 | 0 | 0 | 20.51 | 22-76 - functions-secrets-get.ts | 57.14 | 100 | 0 | 57.14 | 16-26 - functions-secrets-prune.ts | 32.26 | 0 | 0 | 33.33 | 24-68 - functions-secrets-set.ts | 28.85 | 0 | 0 | 28.85 | 35-120 - functions-shell.ts | 100 | 100 | 100 | 100 | - help.ts | 29.41 | 0 | 0 | 29.41 | 13-30 - hosting-channel-create.ts | 36.59 | 0 | 0 | 36.59 | 33-101 - hosting-channel-delete.ts | 46.15 | 0 | 0 | 46.15 | 26-66 - hosting-channel-deploy.ts | 18.28 | 0 | 0 | 18.68 | 61-222 - hosting-channel-list.ts | 50 | 0 | 0 | 50 | 26-46 - hosting-channel-open.ts | 43.33 | 0 | 0 | 43.33 | 27-59 - hosting-clone.ts | 15.38 | 0 | 0 | 15.38 | 33-159 - hosting-disable.ts | 56.25 | 0 | 0 | 56.25 | 18-38 - hosting-sites-create.ts | 33.33 | 0 | 0 | 33.33 | 23-72 - hosting-sites-delete.ts | 52.17 | 0 | 0 | 52.17 | 24-53 - hosting-sites-get.ts | 42.11 | 0 | 0 | 42.11 | 14-28 - hosting-sites-list.ts | 45 | 0 | 0 | 45 | 19-32 - index.ts | 95.83 | 60 | 100 | 95.83 | 56-61,120 - init.ts | 32.88 | 0 | 25 | 32.39 | 24,97-220 - ...rnaltesting-frameworks-compose.ts | 50 | 0 | 0 | 50 | 12-20 - ...rnaltesting-functions-discover.ts | 50 | 0 | 0 | 50 | 13-25 - login-add.ts | 31.82 | 0 | 0 | 33.33 | 16-52 - login-ci.ts | 50 | 0 | 0 | 50 | 16-32 - login-list.ts | 30 | 0 | 0 | 31.58 | 12-31 - login-use.ts | 35.29 | 0 | 0 | 37.5 | 11-29 - login.ts | 30.56 | 0 | 0 | 30.56 | 20-80 - logout.ts | 17.39 | 0 | 0 | 17.78 | 28-101 - open.ts | 35.71 | 0 | 16.67 | 35.9 | 70-115 - projects-addfirebase.ts | 50 | 0 | 0 | 50 | 11-19 - projects-create.ts | 33.33 | 0 | 0 | 33.33 | 29-50 - projects-list.ts | 28.13 | 0 | 0 | 28.13 | 14-46,55-68 - remoteconfig-get.ts | 33.33 | 0 | 0 | 33.33 | 23-26,39-81 - remoteconfig-rollback.ts | 39.13 | 0 | 0 | 39.13 | 23-54 - remoteconfig-versions-list.ts | 55.56 | 0 | 0 | 58.82 | 15,33-42 - serve.ts | 36.84 | 0 | 0 | 38.89 | 18-22,38-78 - setup-emulators-database.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-firestore.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-pubsub.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-storage.ts | 83.33 | 100 | 0 | 83.33 | 10 - setup-emulators-ui.ts | 83.33 | 100 | 0 | 83.33 | 10 - target-apply.ts | 46.67 | 0 | 0 | 46.67 | 13-30 - target-clear.ts | 50 | 0 | 0 | 50 | 11-17 - target-remove.ts | 50 | 0 | 0 | 50 | 11-19 - target.ts | 28.57 | 0 | 0 | 28.57 | 13-15,23-39 - use.ts | 10.23 | 0 | 0 | 10.23 | 14-31,44-185 - src/crashlytics | 40 | 10 | 0 | 40 | - buildToolsJarHelper.ts | 40 | 10 | 0 | 40 | 24-51,58-67 - src/database | 81.27 | 54.37 | 90 | 80.76 | - api.ts | 100 | 100 | 100 | 100 | - import.ts | 96.88 | 89.74 | 100 | 96.77 | 97,247,270-271 - listRemote.ts | 90.48 | 50 | 100 | 90 | 44,47 - remove.ts | 96.36 | 87.5 | 100 | 96.15 | 100,114 - removeRemote.ts | 100 | 100 | 100 | 100 | - rulesConfig.ts | 10.87 | 0 | 0 | 10.87 | 18-20,28-92 - settings.ts | 53.33 | 0 | 33.33 | 53.33 | 39-46,67-73 - src/deploy | 22.73 | 0 | 0 | 22.67 | - index.ts | 30.68 | 0 | 0 | 30.59 | 39-40,54-142 - lifecycleHooks.ts | 12.12 | 0 | 0 | 12.31 | 11-143,151-155 - src/deploy/database | 38 | 0 | 0 | 34.04 | - deploy.ts | 100 | 100 | 0 | 100 | - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 25.81 | 0 | 0 | 25.81 | 12-54 - release.ts | 33.33 | 0 | 0 | 33.33 | 7-27 - src/deploy/extensions | 35.16 | 9.4 | 14.29 | 36.28 | - deploy.ts | 26.47 | 0 | 0 | 29.03 | 13-67 - deploymentSummary.ts | 34.48 | 4.17 | 9.09 | 37.5 | ...47,53-54,60-61 - errors.ts | 23.08 | 100 | 0 | 23.08 | 13-35 - index.ts | 100 | 100 | 0 | 100 | - planner.ts | 58.62 | 57.5 | 70 | 59.3 | ...06,221,229,238 - prepare.ts | 25.68 | 0 | 0 | 28.79 | ...11,115,119,123 - release.ts | 25 | 0 | 0 | 25 | 12-55 - secrets.ts | 14.46 | 0 | 0 | 15 | ...3,49-50,54-245 - tasks.ts | 21.43 | 0 | 0 | 21.82 | ...36-161,172-186 - v2FunctionHelper.ts | 81.25 | 50 | 60 | 83.87 | 15-16,36-43 - validate.ts | 44.44 | 0 | 0 | 44.44 | 6-13 - src/deploy/firestore | 25 | 0 | 0 | 23.17 | - deploy.ts | 21.43 | 0 | 0 | 21.43 | 14-49,65 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 16.67 | 0 | 0 | 16.67 | 33-60,73-110 - release.ts | 21.43 | 0 | 0 | 21.43 | 12-30 - src/deploy/functions | 69.72 | 59.75 | 75.48 | 69.91 | - backend.ts | 91.57 | 77.45 | 97.14 | 91.46 | 144-157,413 - build.ts | 74.56 | 52.08 | 86.36 | 74.56 | ...89,592,594,598 - cel.ts | 89.77 | 86.34 | 100 | 89.67 | ...64,474,478,505 - checkIam.ts | 70.09 | 57.69 | 65 | 71.17 | 28-45,68-115,272 - containerCleaner.ts | 85.71 | 68.63 | 93.18 | 85.47 | ...06,416-417,425 - deploy.ts | 34.72 | 27.78 | 33.33 | 34.78 | 23-89,104-120,147 - ensure.ts | 78.33 | 73.68 | 75 | 78.33 | 25-41,83 - functionsDeployHelper.ts | 89.89 | 80 | 77.27 | 91.25 | ...43,220-223,229 - index.ts | 100 | 100 | 0 | 100 | - params.ts | 38.7 | 25.74 | 53.7 | 38.79 | ...67-768,779-824 - prepare.ts | 35.71 | 39.86 | 33.33 | 36.59 | ...08,413,434-462 - prepareFunctionsUpload.ts | 33.9 | 15.38 | 28.57 | 32.76 | 28-123,131 - pricing.ts | 98 | 94.44 | 100 | 98 | 152 - prompts.ts | 81.69 | 85.11 | 72.73 | 81.43 | 81-119,150 - triggerRegionHelper.ts | 100 | 100 | 100 | 100 | - validate.ts | 97.24 | 97.37 | 96.55 | 97.86 | 233-234,289 - src/deploy/functions/cache | 100 | 73.91 | 100 | 100 | - applyHash.ts | 100 | 77.78 | 100 | 100 | 14-20 - hash.ts | 100 | 60 | 100 | 100 | 13-35 - src/deploy/functions/release | 86.04 | 82.54 | 91.24 | 86.17 | - executor.ts | 100 | 84.62 | 100 | 100 | 28-30 - fabricator.ts | 88.06 | 81.9 | 92.75 | 87.88 | ...01,605,618,622 - index.ts | 26.67 | 0 | 0 | 28.07 | 25-102,112-124 - planner.ts | 92.86 | 87.63 | 100 | 92.86 | ...34,267,272-279 - reporter.ts | 97.58 | 89.32 | 100 | 97.48 | 190,237,241 - sourceTokenScraper.ts | 93.55 | 91.89 | 100 | 93.1 | 39,45 - timer.ts | 100 | 100 | 100 | 100 | - src/deploy/functions/runtimes | 64 | 20 | 75 | 64 | - index.ts | 64 | 20 | 75 | 64 | 135-151 - ...eploy/functions/runtimes/discovery | 87.4 | 80.49 | 88 | 87.4 | - index.ts | 91.3 | 76.92 | 100 | 91.3 | 49,82,93-94 - parsing.ts | 86.21 | 85.29 | 100 | 86.21 | ...20-123,126,149 - v1alpha1.ts | 86.67 | 78.23 | 83.33 | 86.67 | ...26-428,432,440 - src/deploy/functions/runtimes/node | 62.59 | 56.4 | 34.15 | 62.9 | - extractTriggers.js | 93.75 | 92.31 | 100 | 93.75 | 17 - index.ts | 39.62 | 21.05 | 13.33 | 40 | ...,79-82,125-264 - parseRuntimeAndValidateSDK.ts | 93.33 | 93.75 | 100 | 93.33 | 54,62 - parseTriggers.ts | 68.89 | 63.39 | 35.29 | 69.27 | ...41,544,549-557 - validate.ts | 100 | 100 | 100 | 100 | - versioning.ts | 46.43 | 26.92 | 25 | 46.43 | ...05,123,142-143 - src/deploy/functions/runtimes/python | 28.87 | 11.9 | 15.79 | 29.17 | - index.ts | 28.87 | 11.9 | 15.79 | 29.17 | ...71-121,130-203 - src/deploy/functions/services | 96.45 | 82.18 | 100 | 96.3 | - auth.ts | 92 | 80.31 | 100 | 91.67 | 29,67,112,148 - database.ts | 100 | 100 | 100 | 100 | - firebaseAlerts.ts | 100 | 100 | 100 | 100 | - firestore.ts | 100 | 80 | 100 | 100 | 14 - index.ts | 100 | 87.5 | 100 | 100 | 166 - remoteConfig.ts | 100 | 100 | 100 | 100 | - storage.ts | 95.83 | 76.92 | 100 | 95.83 | 39 - testLab.ts | 100 | 100 | 100 | 100 | - src/deploy/hosting | 59.11 | 60.37 | 49.09 | 58.56 | - convertConfig.ts | 88.79 | 86.61 | 100 | 88.5 | ...97,229,251-254 - deploy.ts | 18.97 | 0 | 0 | 18.97 | 18-113 - hashcache.ts | 92.59 | 75 | 100 | 92.59 | 33,53 - index.ts | 100 | 100 | 0 | 100 | - prepare.ts | 83.16 | 74.34 | 100 | 83.16 | ...57-162,197,204 - release.ts | 96.3 | 91.67 | 100 | 96.3 | 25 - uploader.ts | 13.22 | 0 | 0 | 13.22 | 20-22,46-268 - src/deploy/remoteconfig | 59.38 | 43.24 | 42.86 | 58.06 | - deploy.ts | 100 | 100 | 0 | 100 | - functions.ts | 71.88 | 69.57 | 75 | 71.88 | 17-29,42,45,48 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 31.25 | 0 | 0 | 31.25 | 8-20 - release.ts | 33.33 | 0 | 0 | 33.33 | 10-16 - src/deploy/storage | 46.97 | 21.43 | 66.67 | 44.44 | - deploy.ts | 42.86 | 0 | 0 | 42.86 | 10-14 - index.ts | 100 | 100 | 100 | 100 | - prepare.ts | 13.89 | 0 | 0 | 13.89 | 14-64 - release.ts | 100 | 100 | 100 | 100 | - src/emulator | 32.47 | 20.06 | 25.14 | 32.51 | - ExpressBasedEmulator.ts | 84.31 | 57.14 | 81.82 | 83.67 | 38-48,52,90-94 - adminSdkConfig.ts | 38.71 | 41.67 | 40 | 38.71 | 42-91 - commandUtils.ts | 27.68 | 16.07 | 3.57 | 27.8 | ...25-452,469-550 - constants.ts | 77.27 | 38.46 | 60 | 77.27 | 106-108,114-133 - controller.ts | 12.87 | 0 | 0 | 13.04 | ...73-912,925-992 - databaseEmulator.ts | 15.56 | 0 | 0 | 15.73 | 28-215 - dns.ts | 100 | 100 | 100 | 100 | - download.ts | 20 | 0 | 0 | 20.69 | 16-43,51-136 - downloadableEmulators.ts | 24.62 | 8.82 | 9.09 | 24.62 | ...84-490,503-530 - emulatorLogger.ts | 40.5 | 25 | 90 | 40 | ...86-287,306-319 - env.ts | 17.39 | 0 | 0 | 17.39 | 14-40 - eventarcEmulator.ts | 10.23 | 0 | 0 | 10.23 | 31-186 - eventarcEmulatorUtils.ts | 78.57 | 72.5 | 100 | 78.57 | 8,11,14,45,58-60 - extensionsEmulator.ts | 44.36 | 27.78 | 30 | 44.7 | ...48-249,269-373 - firestoreEmulator.ts | 20.41 | 0 | 0 | 21.28 | 37-138 - functionsEmulator.ts | 7.97 | 0.36 | 3.75 | 8.03 | ...7,192,201-1594 - functionsEmulatorShared.ts | 48.89 | 38.1 | 26.09 | 48.88 | ...41-445,454-463 - functionsEmulatorShell.ts | 18.18 | 0 | 0 | 19.35 | 16-77 - functionsEmulatorUtils.ts | 96.23 | 90.91 | 90.91 | 96.23 | 70,79 - functionsRuntimeWorker.ts | 72.02 | 63.54 | 63.46 | 72.34 | ...33-270,360-370 - hostingEmulator.ts | 23.53 | 0 | 0 | 23.53 | 14-48 - hub.ts | 16.49 | 0 | 0 | 16.49 | 45-215 - hubClient.ts | 14.29 | 0 | 0 | 14.29 | 9-63 - hubExport.ts | 14.14 | 0 | 0 | 14.43 | 56-297 - loggingEmulator.ts | 13.85 | 0 | 0 | 14.75 | 40-156 - portUtils.ts | 62.59 | 45.83 | 66.67 | 61.76 | ...65,389-449,454 - pubsubEmulator.ts | 12.94 | 0 | 0 | 13.1 | 47-257 - registry.ts | 88.71 | 84 | 75 | 88.52 | ...,84,91,114-116 - types.ts | 47.13 | 24.39 | 22.73 | 47.13 | ...09-273,297-346 - ui.ts | 38.1 | 0 | 0 | 38.1 | 16-59 - workQueue.ts | 73.85 | 51.72 | 68.75 | 73.85 | ...06-123,139-140 - src/emulator/auth | 85.33 | 77.49 | 82.24 | 85.24 | - apiSpec.ts | 100 | 100 | 100 | 100 | - cloudFunctions.ts | 90.48 | 75 | 100 | 90 | 39,43 - errors.ts | 80 | 60 | 54.55 | 80 | 19,61,76,82,88,94 - handlers.ts | 11.43 | 0 | 16.67 | 11.43 | ...72-211,215-312 - index.ts | 22.73 | 4.88 | 5.88 | 22.73 | 32-191 - operations.ts | 91.49 | 84.32 | 96.47 | 91.46 | ...3245,3249,3253 - server.ts | 83.4 | 78.05 | 72.34 | 83.06 | ...54,491,556,610 - state.ts | 92.02 | 84.81 | 96.15 | 92.2 | ...21,782,958-959 - utils.ts | 91.84 | 33.33 | 90.91 | 91.3 | 160-165,181 - widget_ui.ts | 100 | 100 | 100 | 100 | - src/emulator/extensions | 97.78 | 85.19 | 100 | 97.78 | - postinstall.ts | 100 | 100 | 100 | 100 | - validation.ts | 97.14 | 84 | 100 | 97.14 | 78 - src/emulator/shared | 10 | 0 | 0 | 10 | - request.ts | 10 | 0 | 0 | 10 | 5-17 - src/emulator/storage | 49.32 | 34.81 | 52.73 | 49.66 | - cloudFunctions.ts | 35 | 11.11 | 50 | 35 | 27-29,41-108 - crc.ts | 100 | 100 | 100 | 100 | - errors.ts | 100 | 100 | 100 | 100 | - files.ts | 26.38 | 20.95 | 37.04 | 27.07 | ...52-522,530-662 - index.ts | 26.42 | 0 | 0 | 26.42 | 43-149 - metadata.ts | 55.94 | 46.73 | 66.67 | 56.5 | ...66,470,474,478 - multipart.ts | 97.5 | 92.31 | 100 | 97.5 | 33 - persistence.ts | 93.48 | 69.23 | 92.86 | 93.48 | 29,62,72 - server.ts | 24.24 | 0 | 0 | 24.24 | 18-88 - upload.ts | 72.58 | 41.67 | 73.33 | 72.58 | ...20,223,233-244 - src/emulator/storage/apis | 5.31 | 0 | 0 | 5.33 | - firebase.ts | 4.67 | 0 | 0 | 4.69 | 25-550 - gcloud.ts | 5.47 | 0 | 0 | 5.5 | 23-463 - shared.ts | 9.38 | 0 | 0 | 9.38 | 13-62 - src/emulator/storage/rules | 25.26 | 9.03 | 9.52 | 25.61 | - config.ts | 85.71 | 71.43 | 100 | 85.71 | 56,61-70 - manager.ts | 12.24 | 0 | 0 | 12.5 | 43-158 - runtime.ts | 11.11 | 0 | 0 | 11.31 | ...84-100,105-502 - types.ts | 100 | 100 | 100 | 100 | - utils.ts | 27.27 | 0 | 0 | 27.27 | ...-81,92,108-140 - src/extensions | 74.02 | 57.13 | 78.65 | 73.81 | - askUserForEventsConfig.ts | 74.51 | 32.35 | 77.78 | 72.92 | 20,38-59,90 - askUserForParam.ts | 67.74 | 61.32 | 69.23 | 67.33 | ...63,373-376,387 - billingMigrationHelper.ts | 93.1 | 56.25 | 75 | 92.86 | 57-58 - change-log.ts | 77.78 | 73.68 | 71.43 | 77.05 | 56-75,105-106,122 - checkProjectBilling.ts | 86.36 | 60 | 100 | 85.37 | 17,31-34,68-69 - diagnose.ts | 90.91 | 60 | 100 | 90.91 | 35-42 - displayExtensionInfo.ts | 95.38 | 80 | 92.86 | 95.16 | 66,82-83 - etags.ts | 94.12 | 83.33 | 85.71 | 94.12 | 8 - export.ts | 56.82 | 16.67 | 50 | 58.14 | 51-84 - extensionsApi.ts | 78.82 | 65.87 | 95 | 78.82 | ...53-456,533-536 - extensionsHelper.ts | 53.21 | 37.61 | 57.78 | 53 | ...1231,1239-1245 - listExtensions.ts | 93.55 | 68.75 | 100 | 93.55 | 38-39 - localHelper.ts | 81.58 | 50 | 80 | 81.58 | 34-43,58 - manifest.ts | 83.61 | 57.63 | 85.71 | 83.61 | ...12,268,279,283 - metricsUtils.ts | 88.89 | 74.42 | 100 | 88.89 | ...5,50,86,98,126 - paramHelper.ts | 82.5 | 65.22 | 80 | 82.05 | ...05-214,218-219 - provisioningHelper.ts | 98.48 | 93.02 | 100 | 98.39 | 67 - publishHelpers.ts | 66.67 | 100 | 0 | 66.67 | 4 - publisherApi.ts | 83.84 | 60 | 100 | 83.84 | ...42-245,322-325 - refs.ts | 87.5 | 66.67 | 87.5 | 87.5 | 33,72,89,98 - resolveSource.ts | 26.67 | 0 | 0 | 26.67 | 20-37 - secretsUtils.ts | 73.81 | 66.67 | 75 | 73.17 | 13-14,24-31,64-70 - tos.ts | 95.83 | 77.78 | 100 | 95.74 | 88,108 - types.ts | 100 | 100 | 100 | 100 | - updateHelper.ts | 84.38 | 68.75 | 87.5 | 84.38 | ...73,120-142,221 - utils.ts | 39.39 | 26.32 | 22.22 | 41.94 | ...55-60,70,86-88 - versionHelper.ts | 25 | 0 | 0 | 25 | 15-21 - warnings.ts | 96.3 | 75 | 80 | 96.15 | 55 - src/extensions/emulator | 62.45 | 30.69 | 48.78 | 62.22 | - optionsHelper.ts | 43.36 | 4.84 | 36.84 | 43.36 | 22-44,153-290 - specHelper.ts | 62.26 | 57.14 | 30.77 | 63.46 | ...48-49,59-75,99 - triggerHelper.ts | 96.83 | 80 | 100 | 96.67 | 144,151 - src/firestore | 36.53 | 37.7 | 35.2 | 36.8 | - api-sort.ts | 83.82 | 70.45 | 69.23 | 83.58 | ...65,172-180,188 - api-types.ts | 100 | 100 | 100 | 100 | - api.ts | 29.21 | 33.95 | 25.42 | 29.58 | ...73,582,671-867 - checkDatabaseType.ts | 40 | 100 | 0 | 40 | 16-24 - delete.ts | 6.18 | 0 | 0 | 6.29 | 72-568 - encodeFirestoreValue.ts | 100 | 96.3 | 100 | 100 | 34 - fsConfig.ts | 7.5 | 0 | 0 | 7.5 | 12-77 - util.ts | 82.35 | 70 | 100 | 82.35 | 30,35,52 - validator.ts | 85.71 | 70 | 80 | 85.71 | 39,48-49 - src/frameworks | 25.22 | 9.12 | 25 | 26.07 | - constants.ts | 83.87 | 100 | 42.86 | 83.87 | 9-14,63,73,77 - index.ts | 11.46 | 0 | 0 | 12.36 | ...96-104,117-577 - utils.ts | 41.35 | 29.27 | 38.1 | 41.13 | ...90-294,303-325 - src/frameworks/angular | 11.11 | 0.73 | 3.45 | 12.03 | - index.ts | 24.53 | 3.57 | 6.25 | 26.53 | ...64-166,185-248 - utils.ts | 4.31 | 0 | 0 | 4.66 | ...25-368,383-397 - src/frameworks/astro | 85.25 | 75 | 81.82 | 89.47 | - index.ts | 92.16 | 72.73 | 88.89 | 97.87 | 77 - utils.ts | 50 | 100 | 50 | 50 | 12-18 - src/frameworks/compose | 17.65 | 0 | 0 | 17.65 | - index.ts | 17.65 | 0 | 0 | 17.65 | 9-37 - src/frameworks/compose/discover | 74.39 | 54.17 | 77.27 | 73.33 | - filesystem.ts | 63.33 | 25 | 75 | 63.33 | ...31,38-39,50-57 - frameworkMatcher.ts | 88.89 | 83.33 | 93.33 | 89.47 | 84,87-88,93 - frameworkSpec.ts | 100 | 100 | 100 | 100 | - index.ts | 16.67 | 100 | 0 | 16.67 | 7-25 - src/frameworks/compose/driver | 45.16 | 20.45 | 45.16 | 44.72 | - docker.ts | 47.19 | 15.63 | 56.52 | 46.59 | ...,89-90,101-207 - hooks.ts | 100 | 100 | 100 | 100 | - index.ts | 44.44 | 0 | 0 | 44.44 | 12-18 - local.ts | 20 | 0 | 0 | 20 | 8-44 - src/frameworks/express | 18.06 | 5.41 | 0 | 20 | - index.ts | 18.06 | 5.41 | 0 | 20 | ...4,38-93,97-109 - src/frameworks/flutter | 91.11 | 66.67 | 100 | 95.12 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 91.89 | 68.75 | 100 | 96.97 | 47 - utils.ts | 83.33 | 50 | 100 | 83.33 | 7 - src/frameworks/lit | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/next | 39.07 | 21.63 | 42.25 | 39.66 | - constants.ts | 100 | 100 | 100 | 100 | - index.ts | 14.17 | 0 | 0 | 14.88 | ...80-553,561-608 - utils.ts | 95.19 | 85.48 | 96.77 | 95.92 | 150,218,359-361 - src/frameworks/nuxt | 66.67 | 41.67 | 66.67 | 69.7 | - index.ts | 61.9 | 35 | 55.56 | 65.52 | ...0-74,78-85,101 - utils.ts | 100 | 75 | 100 | 100 | 10 - src/frameworks/nuxt2 | 40.98 | 38.46 | 22.22 | 43.1 | - index.ts | 40.98 | 38.46 | 22.22 | 43.1 | ...,78-96,100-118 - src/frameworks/preact | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/react | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/svelte | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - src/frameworks/sveltekit | 37.84 | 10 | 0 | 36.11 | - index.ts | 37.84 | 10 | 0 | 36.11 | 17-20,24-30,35-53 - src/frameworks/vite | 33.33 | 0 | 17.65 | 30.65 | - index.ts | 33.33 | 0 | 17.65 | 30.65 | ...7,81-83,87-113 - src/functions | 90.45 | 81.48 | 83.58 | 90.17 | - constants.ts | 100 | 100 | 100 | 100 | - ensureTargeted.ts | 100 | 100 | 100 | 100 | - env.ts | 97.56 | 96.61 | 87.5 | 97.48 | 204,254,410 - functionslog.ts | 100 | 100 | 100 | 100 | - projectConfig.ts | 95.24 | 90.48 | 100 | 95 | 15,100 - python.ts | 46.15 | 0 | 0 | 46.15 | 16-18,34-38 - runtimeConfigExport.ts | 76 | 69.57 | 64.71 | 75 | ...88,136,152-166 - secrets.ts | 92.25 | 70.37 | 94.74 | 92.13 | ...14,253,323-327 - src/functions/events | 100 | 100 | 100 | 100 | - index.ts | 100 | 100 | 100 | 100 | - v1.ts | 100 | 100 | 100 | 100 | - v2.ts | 100 | 100 | 100 | 100 | - src/gcp | 63.43 | 54.16 | 38.42 | 63.42 | - artifactregistry.ts | 71.43 | 100 | 0 | 71.43 | 26-27 - auth.ts | 77.78 | 100 | 50 | 77.78 | 25-33 - cloudbilling.ts | 57.14 | 0 | 0 | 57.14 | 19-23,35-42,50-54 - cloudfunctions.ts | 75.56 | 70 | 76.19 | 75.42 | ...14,652,684-685 - cloudfunctionsv2.ts | 69.19 | 55 | 53.33 | 69.05 | ...14,718,726,750 - cloudlogging.ts | 50 | 100 | 0 | 50 | 36-49 - cloudmonitoring.ts | 100 | 100 | 100 | 100 | - cloudscheduler.ts | 88.51 | 72.22 | 88.89 | 88.51 | ...00,254,257,293 - cloudtasks.ts | 78.82 | 57.45 | 46.15 | 78.82 | ...43,148-149,197 - docker.ts | 28.57 | 0 | 20 | 28.57 | 76,93-120 - eventarc.ts | 50 | 0 | 0 | 50 | ...68-73,81-86,93 - firedata.ts | 35.71 | 0 | 0 | 35.71 | 13-18,29-39 - firestore.ts | 32 | 0 | 0 | 32 | ...54-61,75,89-97 - iam.ts | 67.65 | 42.86 | 28.57 | 67.65 | ...42-145,165-170 - identityPlatform.ts | 39.13 | 0 | 0 | 39.13 | ...89-193,208-220 - index.ts | 100 | 100 | 100 | 100 | - location.ts | 100 | 100 | 100 | 100 | - proto.ts | 90 | 86 | 92.31 | 89.74 | 29-38,171 - pubsub.ts | 52.94 | 100 | 0 | 52.94 | ...39-40,44-48,52 - resourceManager.ts | 30.56 | 0 | 0 | 31.43 | ...68-103,112-136 - rules.ts | 23.6 | 0 | 0 | 24.42 | ...61,269-272,277 - run.ts | 86.67 | 56 | 83.33 | 86.49 | ...04-209,218-222 - runtimeconfig.ts | 18.6 | 0 | 0 | 18.6 | 11-146 - secretManager.ts | 49.15 | 39.66 | 33.33 | 47.37 | ...34,344-347,354 - serviceusage.ts | 63.64 | 100 | 0 | 63.64 | 23-29 - storage.ts | 23.08 | 0 | 0 | 23.53 | ...49-257,273-281 - src/hosting | 84.33 | 75.78 | 89.89 | 84.23 | - api.ts | 85.44 | 75.41 | 85.71 | 85.99 | ...48-649,673-679 - cloudRunProxy.ts | 96.97 | 81.25 | 100 | 96.97 | 62 - config.ts | 76.92 | 69.81 | 88 | 75.61 | ...66-290,301-312 - expireUtils.ts | 94.74 | 87.5 | 100 | 94.74 | 49 - functionsProxy.ts | 88 | 50 | 100 | 88 | 30,40-41 - implicitInit.ts | 30.3 | 0 | 0 | 30.3 | 32-88 - initMiddleware.ts | 94.29 | 93.75 | 75 | 94.29 | 50-54 - proxy.ts | 93.67 | 88.33 | 100 | 93.67 | 83,85-87,167 - runTags.ts | 94.67 | 83.87 | 100 | 94.52 | 33,54,127,153 - src/init | 36.84 | 0 | 0 | 36.84 | - index.ts | 36.84 | 0 | 0 | 36.84 | 35-54 - src/init/features | 49.22 | 15.84 | 62.96 | 46.94 | - account.ts | 18.75 | 0 | 0 | 18.75 | 15-49,62-84 - database.ts | 17.81 | 0 | 0 | 17.81 | 41-118,128-212 - emulators.ts | 19.05 | 0 | 0 | 19.05 | 15-116 - index.ts | 100 | 100 | 100 | 100 | - project.ts | 98.25 | 88.89 | 100 | 98.25 | 89 - remoteconfig.ts | 30.77 | 0 | 0 | 30.77 | 23-46 - storage.ts | 100 | 100 | 100 | 100 | - src/init/features/extensions | 44.44 | 0 | 0 | 44.44 | - index.ts | 44.44 | 0 | 0 | 44.44 | 11-16 - src/init/features/firestore | 43.56 | 21.43 | 11.76 | 43.56 | - index.ts | 96 | 75 | 100 | 96 | 37 - indexes.ts | 28.57 | 0 | 0 | 28.57 | 18-77 - rules.ts | 24.39 | 0 | 0 | 24.39 | 18-95 - src/init/features/functions | 83.67 | 66.67 | 84 | 84.14 | - index.ts | 86.08 | 75.86 | 83.33 | 87.01 | ...35-139,189-190 - javascript.ts | 95.45 | 50 | 100 | 95.45 | 40 - npm-dependencies.ts | 37.5 | 25 | 40 | 37.5 | 16-32 - typescript.ts | 93.33 | 50 | 100 | 93.33 | 50-52 - src/init/features/hosting | 14.67 | 0 | 0 | 14.84 | - github.ts | 11.92 | 0 | 0 | 11.92 | 53-637,641 - index.ts | 22.73 | 0 | 0 | 23.81 | 28-198 - src/management | 82.2 | 74.38 | 86 | 82.14 | - apps.ts | 82.5 | 82.86 | 81.25 | 82.5 | ...00-411,432-440 - database.ts | 88.1 | 72 | 90 | 88.1 | ...02-206,263,267 - projects.ts | 78.2 | 69.44 | 87.5 | 78.03 | ...99,155,172,254 - src/remoteconfig | 96.15 | 72.73 | 100 | 96.15 | - get.ts | 92.59 | 66.67 | 100 | 92.59 | 32-33 - rollback.ts | 100 | 100 | 100 | 100 | - versionslist.ts | 100 | 80 | 100 | 100 | 24 - src/serve | 31.3 | 0 | 0 | 32.03 | - functions.ts | 22.22 | 0 | 0 | 22.22 | 19-88 - hosting.ts | 35.38 | 0 | 0 | 36.51 | ...09-146,153-157 - index.ts | 33.33 | 0 | 0 | 34.48 | 23-57 - src/throttler | 96.88 | 93.1 | 96.88 | 96.88 | - queue.ts | 90.91 | 75 | 100 | 90.91 | 17 - stack.ts | 93.33 | 83.33 | 100 | 93.33 | 23 - throttler.ts | 97.76 | 95.83 | 96.15 | 97.76 | 169,193,221 - src/throttler/errors | 100 | 100 | 100 | 100 | - retries-exhausted-error.ts | 100 | 100 | 100 | 100 | - task-error.ts | 100 | 100 | 100 | 100 | - timeout-error.ts | 100 | 100 | 100 | 100 | ----------------------------------------|---------|----------|---------|---------|------------------- From 3376a3ce5f2803f4830fb11bc86928becca11eac Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 14:02:15 -0700 Subject: [PATCH 101/104] Added mockFileSystem for testing --- .../testapps/expressApp/package-lock.json | 604 ------------------ .../discover/testapps/expressApp/package.json | 15 - 2 files changed, 619 deletions(-) delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package-lock.json delete mode 100644 src/frameworks/compose/discover/testapps/expressApp/package.json diff --git a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json b/src/frameworks/compose/discover/testapps/expressApp/package-lock.json deleted file mode 100644 index 36787cbc8cc..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package-lock.json +++ /dev/null @@ -1,604 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "expressapp", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/src/frameworks/compose/discover/testapps/expressApp/package.json b/src/frameworks/compose/discover/testapps/expressApp/package.json deleted file mode 100644 index 4ffc74a94ff..00000000000 --- a/src/frameworks/compose/discover/testapps/expressApp/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "expressapp", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} From 56bea8e38aae023ec6fb27ee032dbcb0e145df52 Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Fri, 9 Jun 2023 18:27:32 -0700 Subject: [PATCH 102/104] Added code for Node runtime --- src/frameworks/compose/discover/runtime/node.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index a6d686b014e..c17758c745e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,7 +32,6 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); - return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -68,7 +67,6 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } - return NPM; } @@ -160,7 +158,6 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } - return command; } From ce7344a85e52aab3ed1598233bbed4debf1df7af Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Mon, 12 Jun 2023 14:02:31 -0700 Subject: [PATCH 103/104] Tests for runtime functionality --- src/frameworks/compose/discover/runtime/node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index c17758c745e..2ed5858a833 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -158,6 +158,7 @@ export class NodejsRuntime implements Runtime { command.cmd.replace(/^\S+/, packageManager); } } + return command; } From ae2fadba5881487d74b3091e8bd3170ebab6f8dc Mon Sep 17 00:00:00 2001 From: Sairam Sakhamuri Date: Tue, 13 Jun 2023 09:59:27 -0700 Subject: [PATCH 104/104] Formatting --- src/frameworks/compose/discover/runtime/node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frameworks/compose/discover/runtime/node.ts b/src/frameworks/compose/discover/runtime/node.ts index 2ed5858a833..a6d686b014e 100644 --- a/src/frameworks/compose/discover/runtime/node.ts +++ b/src/frameworks/compose/discover/runtime/node.ts @@ -32,6 +32,7 @@ export class NodejsRuntime implements Runtime { const areAllFilesPresent = await Promise.all( this.runtimeRequiredFiles.map((file) => fs.exists(file)) ); + return Promise.resolve(areAllFilesPresent.every((present) => present)); } @@ -67,6 +68,7 @@ export class NodejsRuntime implements Runtime { if (await fs.exists(YARN_LOCK)) { return YARN; } + return NPM; }